|
@ -11,27 +11,8 @@ Core Analyse::new_core() { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
class test_c { |
|
|
|
|
|
public: |
|
|
|
|
|
test_c() { |
|
|
|
|
|
std::cout << "class init" << std::endl; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
struct test_t { |
|
|
|
|
|
uint64_t data; |
|
|
|
|
|
test_c demo; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void Analyse::start_analyse(uint64_t code) { |
|
|
void Analyse::start_analyse(uint64_t code) { |
|
|
|
|
|
|
|
|
auto t = test_t { |
|
|
|
|
|
.data = 123, |
|
|
|
|
|
// data: 123,
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
auto core = new_core(); |
|
|
auto core = new_core(); |
|
|
|
|
|
|
|
|
cases.empty(); |
|
|
cases.empty(); |
|
@ -43,14 +24,9 @@ void Analyse::start_analyse(uint64_t code) { |
|
|
.code = code, |
|
|
.code = code, |
|
|
.mask = 0, |
|
|
.mask = 0, |
|
|
.step = 0, |
|
|
.step = 0, |
|
|
// .src = std::move(std::vector<analyse_t*>{}),
|
|
|
// .src = std::move(std::list<analyse_t*>{}),
|
|
|
.src = std::move(std::list<analyse_t*>{}), |
|
|
|
|
|
// .src = std::move(std::set<analyse_t*>{}),
|
|
|
|
|
|
// .src = std::move(std::unordered_set<analyse_t*>{}),
|
|
|
|
|
|
}).first->second); |
|
|
}).first->second); |
|
|
|
|
|
|
|
|
// std::cout << "src size: " << cases[code].src.size() << std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
while (!cache.empty()) { |
|
|
while (!cache.empty()) { |
|
|
|
|
|
|
|
|
core.next_step(cache.front()->code, cache.front()->mask); |
|
|
core.next_step(cache.front()->code, cache.front()->mask); |
|
@ -62,27 +38,41 @@ void Analyse::start_analyse(uint64_t code) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Analyse::new_case(uint64_t code, uint64_t mask) { |
|
|
void Analyse::new_case(uint64_t code, uint64_t mask) { |
|
|
auto current = cases.find(code); |
|
|
|
|
|
if (current != cases.end()) { // find existed case
|
|
|
|
|
|
current->second.mask |= mask; // update mask info
|
|
|
|
|
|
|
|
|
|
|
|
// current->second.src.emplace()
|
|
|
|
|
|
|
|
|
|
|
|
if (current->second.step != cache.front()->step) { |
|
|
auto temp = cases.emplace(code, analyse_t { |
|
|
// current->second.src.emplace(cache.front());
|
|
|
.code = code, |
|
|
current->second.src.push_back(cache.front()); |
|
|
.mask = mask, |
|
|
|
|
|
.step = cache.front()->step + 1, |
|
|
|
|
|
.src = std::move(std::list<analyse_t*>{cache.front()}) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (temp.second) { |
|
|
|
|
|
cache.emplace(&temp.first->second); |
|
|
|
|
|
} else { |
|
|
|
|
|
temp.first->second.mask |= mask; |
|
|
|
|
|
|
|
|
|
|
|
if (temp.first->second.step != cache.front()->step) { |
|
|
|
|
|
temp.first->second.src.push_back(cache.front()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cache.emplace(&cases.emplace(code, analyse_t { |
|
|
// auto current = cases.find(code);
|
|
|
.code = code, |
|
|
// if (current != cases.end()) { // find existed case
|
|
|
.mask = mask, |
|
|
// current->second.mask |= mask; // update mask info
|
|
|
.step = cache.front()->step + 1, |
|
|
//
|
|
|
// .src = std::move(std::vector<analyse_t*>{cache.front()}),
|
|
|
// if (current->second.step != cache.front()->step) {
|
|
|
.src = std::move(std::list<analyse_t*>{cache.front()}), |
|
|
// current->second.src.push_back(cache.front());
|
|
|
// .src = std::move(std::set<analyse_t*>{cache.front()}),
|
|
|
// }
|
|
|
// .src = std::move(std::unordered_set<analyse_t*>{cache.front()}),
|
|
|
//
|
|
|
}).first->second); |
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// cache.emplace(&cases.emplace(code, analyse_t {
|
|
|
|
|
|
// .code = code,
|
|
|
|
|
|
// .mask = mask,
|
|
|
|
|
|
// .step = cache.front()->step + 1,
|
|
|
|
|
|
// .src = std::move(std::list<analyse_t*>{cache.front()}),
|
|
|
|
|
|
// }).first->second);
|
|
|
} |
|
|
} |
|
|