[decompiler] Several small fixes (#775)

* fix assorted bugs

* stricter return types

* only look for functions in code files
This commit is contained in:
water111
2021-08-19 20:35:12 -04:00
committed by GitHub
parent 69d0840080
commit 11e11d2c04
48 changed files with 461 additions and 304 deletions
+2 -2
View File
@@ -2564,7 +2564,7 @@ TEST_F(FormRegressionTest, MoveFalse) {
" daddiu sp, sp, 16\n";
std::string type = "(function int symbol)";
std::string expected = "(nonzero? (logand (+ arg0 12) 1))";
std::string expected = "(logtest? (+ arg0 12) 1)";
test_with_expr(func, type, expected, false, "", {{"L17", "A ~A"}});
}
@@ -2934,7 +2934,7 @@ TEST_F(FormRegressionTest, AshPropagation2) {
std::string type = "(function bit-array int symbol)";
std::string expected =
"(let ((v1-2 (-> arg0 bytes (/ arg1 8))))\n"
" (nonzero? (logand v1-2 (ash 1 (logand arg1 7))))\n"
" (logtest? v1-2 (ash 1 (logand arg1 7)))\n"
" )";
test_with_expr(func, type, expected);
}