[Decompiler] Expression 5 (#218)

* new method of inline-array-class

* up to new array

* wip side effect stuff

* prepare for pop barrier stuff

* add pop barrier

* add local vars hack to compiler

* fix bug, make sort work

* add test for array

* bug fixes

* another bug fix

* refactoring env variable print for casts

* more tweaks

* updates

* final cleanup

* codacy fixes
This commit is contained in:
water111
2021-02-01 20:41:37 -05:00
committed by GitHub
parent 51f70b6f4b
commit a870bb53e4
46 changed files with 4123 additions and 369 deletions
+10 -4
View File
@@ -47,9 +47,10 @@ Matcher Matcher::cast(const std::string& type, Matcher value) {
return m;
}
Matcher Matcher::any() {
Matcher Matcher::any(int match_id) {
Matcher m;
m.m_kind = Kind::ANY;
m.m_form_match = match_id;
return m;
}
@@ -85,8 +86,13 @@ Matcher Matcher::deref(const Matcher& root,
return m;
}
bool Matcher::do_match(const Form* input, MatchResult::Maps* maps_out) const {
bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
switch (m_kind) {
case Kind::ANY:
if (m_form_match != -1) {
maps_out->forms[m_form_match] = input;
}
return true;
case Kind::ANY_REG: {
bool got = false;
Variable result;
@@ -285,7 +291,7 @@ Matcher Matcher::any_reg_cast_to_int_or_uint(int match_id) {
{any_reg(match_id), cast("uint", any_reg(match_id)), cast("int", any_reg(match_id))});
}
MatchResult match(const Matcher& spec, const Form* input) {
MatchResult match(const Matcher& spec, Form* input) {
MatchResult result;
result.matched = spec.do_match(input, &result.maps);
return result;
@@ -336,7 +342,7 @@ GenericOpMatcher GenericOpMatcher::func(const Matcher& func_matcher) {
return m;
}
bool GenericOpMatcher::do_match(const GenericOperator& input, MatchResult::Maps* maps_out) const {
bool GenericOpMatcher::do_match(GenericOperator& input, MatchResult::Maps* maps_out) const {
switch (m_kind) {
case Kind::FIXED:
if (input.kind() == GenericOperator::Kind::FIXED_OPERATOR) {