[decompiler] fix rare bug with casts (#1920)

This commit is contained in:
water111
2022-09-26 18:14:54 -04:00
committed by GitHub
parent 5c7a3384e5
commit a22d49ab11
4 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -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;
}
}
}
}
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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)))