[decomp] even more res (#529)

* [decomp] even more `res`

* [decompiler] make `logand` with pointers and constants return pointer

* [decomp] more work

* update offline tests

* fix tests(?)

* `*res-static-buf*`

* fixes

* fix reference

* [opengoal] make `logand` work directly with pointers

* [decomp] `inspect res-lump`

* use the inline methods

* don't use a math mode for pointers

* [compiler] allow optionally setting disassembly output file

* [x86 disasm] Keep casing consistent between instructions and offsets
This commit is contained in:
ManDude
2021-06-01 21:07:45 +01:00
committed by GitHub
parent 3d8013633a
commit 784119188c
20 changed files with 390 additions and 158 deletions
+5 -14
View File
@@ -341,21 +341,12 @@ TEST_F(FormRegressionTest, ExprMethod0Thread) {
" )\n"
" (else\n"
" (let\n"
" ((v1-2\n"
" (logand\n"
" -16\n"
" (the-as int (&+ (-> arg2 heap-cur) 15))\n"
" )\n"
" )\n"
" )\n"
" ((v1-2 (logand -16 (&+ (-> arg2 heap-cur) 15))))\n"
" (set!\n"
" (-> arg2 heap-cur)\n"
" (the-as\n"
" pointer\n"
" (+ (+ v1-2 (the-as int (-> arg1 size))) arg4)\n"
" )\n"
" (&+ (&+ v1-2 (-> arg1 size)) arg4)\n"
" )\n"
" (the-as cpu-thread (+ v1-2 4))\n"
" (the-as cpu-thread (&+ v1-2 4))\n"
" )\n"
" )\n"
" )\n"
@@ -372,7 +363,7 @@ TEST_F(FormRegressionTest, ExprMethod0Thread) {
" (set! (-> obj suspend-hook) (method-of-object obj thread-suspend))\n"
" (set! (-> obj resume-hook) (method-of-object obj thread-resume))\n"
" (set! (-> obj stack-size) arg4)\n"
" (the-as cpu-thread (the-as object obj))\n"
" (the-as cpu-thread (the-as pointer obj))\n"
" )";
test_with_expr(func, type, expected, false, "cpu-thread", {},
"[[[13, 28], \"v0\", \"cpu-thread\"]]",
@@ -2834,4 +2825,4 @@ TEST_F(FormRegressionTest, ExprMethod18DeadPoolHeap) {
" (none)\n"
" )";
test_with_expr(func, type, expected);
}
}