mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 07:07:04 -04:00
[decompiler] fix rare bug with casts (#1920)
This commit is contained in:
@@ -154,14 +154,14 @@ VariableWithCast Env::get_variable_and_cast(const RegisterAccess& access) const
|
||||
type_in_reg.print(), type_in_reg.print());
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (type_of_var != type_in_reg) {
|
||||
// TODO - use the when possible?
|
||||
VariableWithCast result;
|
||||
result.cast = TypeSpec(x.type_name);
|
||||
result.name = lookup_name;
|
||||
return result;
|
||||
if (type_of_var != type_in_reg) {
|
||||
// TODO - use the when possible?
|
||||
VariableWithCast result;
|
||||
result.cast = TypeSpec(x.type_name);
|
||||
result.name = lookup_name;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ FormElement* rewrite_as_countdown(LetElement* in, const Env& env, FormPool& pool
|
||||
body->elts().erase(body->elts().begin());
|
||||
|
||||
return pool.alloc_element<CounterLoopElement>(CounterLoopElement::Kind::COUNTDOWN,
|
||||
in->entries().at(0).dest, *lt_var, *inc_var,
|
||||
in->entries().at(0).dest, *lt_var, ra,
|
||||
in->entries().at(0).src, body);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@
|
||||
(set! s3-0 (-> v0-5 0))
|
||||
)
|
||||
)
|
||||
(the-as (pointer sparticle-launch-group) s3-0)
|
||||
s3-0
|
||||
)
|
||||
(else
|
||||
(-> (the-as (pointer sparticle-launch-group) s3-0) 0)
|
||||
|
||||
+1
-1
@@ -457,7 +457,7 @@
|
||||
(f-in-box (logand t4-1 a1-1))
|
||||
(b-in-box (logand t5-1 a1-1))
|
||||
)
|
||||
(.srl (the-as uint f-flag) (the-as uint front-min) 24)
|
||||
(.srl f-flag (the-as uint front-min) 24)
|
||||
(let ((back-idx (the-as bsp-node (-> node back))))
|
||||
(b! (= f-in-box a1-1) cfg-4 :delay (.srl b-flag (the-as int back-min) 24))
|
||||
(b! (= b-in-box a1-1) cfg-7 :delay (set! t0-5 (the-as uint 1)))
|
||||
|
||||
Reference in New Issue
Block a user