[Compiler/Decompiler] Better support for Bitfield and Enum types (#374)

* compiler fixes, a decent amount of decompiler stuff is working too

* more support in decompiler, fix some casts

* decompile static data too
This commit is contained in:
water111
2021-04-22 19:08:58 -04:00
committed by GitHub
parent 26accb8714
commit 060b125324
35 changed files with 561 additions and 283 deletions
+6 -6
View File
@@ -452,7 +452,7 @@ TEST_F(FormRegressionTest, RemoveMethod0ProcessTree) {
"(let\n"
" ((v0-0 (object-new arg0 arg1 (the-as int (-> arg1 size)))))\n"
" (set! (-> v0-0 name) arg2)\n"
" (set! (-> v0-0 mask) (the-as uint 256))\n"
" (set! (-> v0-0 mask) (process-mask process-tree))\n"
" (set! (-> v0-0 parent) (the-as (pointer process-tree) #f))\n"
" (set! (-> v0-0 brother) (the-as (pointer process-tree) #f))\n"
" (set! (-> v0-0 child) (the-as (pointer process-tree) #f))\n"
@@ -948,7 +948,7 @@ TEST_F(FormRegressionTest, ExprMethod0DeadPool) {
"(let\n"
" ((s3-0 (object-new arg0 arg1 (the-as int (-> arg1 size)))))\n"
" (set! (-> s3-0 name) arg4)\n"
" (set! (-> s3-0 mask) (the-as uint 256))\n"
" (set! (-> s3-0 mask) (process-mask process-tree))\n"
" (set! (-> s3-0 parent) (the-as (pointer process-tree) #f))\n"
" (set! (-> s3-0 brother) (the-as (pointer process-tree) #f))\n"
" (set! (-> s3-0 child) (the-as (pointer process-tree) #f))\n"
@@ -1263,7 +1263,7 @@ TEST_F(FormRegressionTest, ExprMethod0DeadPoolHeap) {
" )\n"
" )\n"
" (set! (-> obj name) arg2)\n"
" (set! (-> obj mask) (the-as uint 256))\n"
" (set! (-> obj mask) (process-mask process-tree))\n"
" (set! (-> obj allocated-length) arg3)\n"
" (set! (-> obj parent) (the-as (pointer process-tree) #f))\n"
" (set! (-> obj brother) (the-as (pointer process-tree) #f))\n"
@@ -2241,7 +2241,7 @@ TEST_F(FormRegressionTest, ExprMethod15DeadPoolHeap) {
" )\n"
" (set! (-> s5-1 1 parent) (the-as (pointer process-tree) (-> s5-1 2)))\n"
" (if (-> s5-1 2)\n"
" (set! (-> s5-1 2 mask) (the-as uint (-> s5-1 1)))\n"
" (set! (-> s5-1 2 mask) (the-as process-mask (-> s5-1 1)))\n"
" (set! (-> arg0 alive-list prev) (the-as dead-pool-heap-rec (-> s5-1 1)))\n"
" )\n"
" (set! (-> s5-1 2) (the-as process-tree (-> arg0 dead-list next)))\n"
@@ -2352,7 +2352,7 @@ TEST_F(FormRegressionTest, ExprMethod17DeadPoolHeap) {
" (when\n"
" (not\n"
" (or\n"
" (nonzero? (logand (-> arg1 mask) 512))\n"
" (nonzero? (logand (-> arg1 mask) (process-mask heap-shrunk)))\n"
" (and (not (-> arg1 next-state)) (not (-> arg1 state)))\n"
" )\n"
" )\n"
@@ -2371,7 +2371,7 @@ TEST_F(FormRegressionTest, ExprMethod17DeadPoolHeap) {
" )\n"
" (set! (-> arg0 first-gap) (find-gap arg0 (the-as dead-pool-heap-rec s5-0)))\n"
" )\n"
" (set! (-> arg1 mask) (logior (-> arg1 mask) 512))\n"
" (set! (-> arg1 mask) (logior (-> arg1 mask) (process-mask heap-shrunk)))\n"
" )\n"
" (if (= (-> arg0 first-shrink) s5-0)\n"
" (set!\n"