mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
[decompiler] fix missing casts issue (#573)
* fix casts issue * fix bug * one last small fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user