[decomp] Small fixes (#541)

* fix a few bugs

* fix local vars missing in top level

* more small fixes

* support missing inline array access case

* one more fix
This commit is contained in:
water111
2021-05-30 19:57:11 -04:00
committed by GitHub
parent c910a22c1b
commit b1a76b2291
32 changed files with 298 additions and 117 deletions
@@ -537,7 +537,7 @@
(+
(-> type-to-make size)
(the-as uint (* len (if (type-type? content-type number)
(-> content-type size)
(the-as int (-> content-type size))
4
)
)
@@ -801,7 +801,7 @@
(the-as
uint
(* (-> obj allocated-length) (if (type-type? (-> obj content-type) number)
(-> obj content-type size)
(the-as int (-> obj content-type size))
4
)
)
@@ -159,7 +159,7 @@
)
(let ((obj (the-as cpu-thread (cond
((-> arg0 top-thread)
(&+ arg3 -7164)
(the-as cpu-thread (&+ arg3 -7164))
)
(else
(let
@@ -183,7 +183,7 @@
)
)
)
(+ v1-2 4)
(the-as cpu-thread (+ v1-2 4))
)
)
)
@@ -627,7 +627,7 @@
)
(-> obj name)
)
#f
(the-as process #f)
)
)
)
@@ -1348,7 +1348,7 @@
)
)
)
(the-as process #f)
(the-as process (the-as process-tree #f))
)
;; definition for function kernel-dispatcher
@@ -1553,7 +1553,7 @@
(when parent
(let ((child (-> parent 0 child)))
(if (= child proc)
(return #f)
(return (the-as (pointer process-tree) #f))
)
(while child
(if (= (-> child 0 brother) proc)
@@ -1562,7 +1562,7 @@
(set! child (-> child 0 brother))
)
)
#f
(the-as (pointer process-tree) #f)
)
)
)
@@ -171,6 +171,7 @@
;; definition for function looping-code
;; INFO: Return type mismatch none vs symbol.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defun looping-code ()
(while #t
(suspend)