[decompiler] fix missing casts issue (#573)

* fix casts issue

* fix bug

* one last small fix
This commit is contained in:
water111
2021-06-09 21:35:13 -04:00
committed by GitHub
parent 12d72c7897
commit 92afd62e2c
102 changed files with 340 additions and 528 deletions
+5 -6
View File
@@ -1515,9 +1515,9 @@ RegisterAccess CallOp::get_set_destination() const {
void CallOp::update_register_info() {
// throw std::runtime_error("CallOp::update_register_info cannot be done until types are known");
m_read_regs.push_back(Register(Reg::GPR, Reg::T9));
// if the type analysis succeeds, it will remove this if the function doesn't return a value.
// but, in the case we want to keep running without type information, we may need a
// renamed variable here, so we add this.
// previously, if the type analysis succeeds, it would remove this if the function doesn't return
// a value. however, this turned out to be not quite right because GOAL internally thinks that all
// functions return a value.
m_write_regs.push_back(Register(Reg::GPR, Reg::V0));
clobber_temps();
}
@@ -1528,9 +1528,8 @@ void CallOp::collect_vars(RegAccessSet& vars) const {
vars.insert(e);
}
if (m_call_type_set && m_call_type.last_arg() != TypeSpec("none")) {
vars.insert(m_return_var);
}
// even if we don't actually return a value, GOAL pretends like we do.
vars.insert(m_return_var);
}
/////////////////////////////