mirror of
https://github.com/open-goal/jak-project
synced 2026-06-06 19:52:01 -04:00
allow terrible method hack to decompiler (#623)
This commit is contained in:
@@ -772,11 +772,13 @@ TP_Type LoadVarOp::get_src_type(const TypeState& input,
|
||||
ro.offset >= 16 && (ro.offset & 3) == 0 && m_size == 4 && m_kind == Kind::UNSIGNED) {
|
||||
// method get of an unknown type. We assume the most general "object" type.
|
||||
auto method_id = (ro.offset - 16) / 4;
|
||||
auto method_info = dts.ts.lookup_method("object", method_id);
|
||||
if (method_id != GOAL_NEW_METHOD && method_id != GOAL_RELOC_METHOD) {
|
||||
// this can get us the wrong thing for `new` methods. And maybe relocate?
|
||||
return TP_Type::make_non_virtual_method(
|
||||
method_info.type.substitute_for_method_call("object"), TypeSpec("object"), method_id);
|
||||
if (method_id <= (int)GOAL_MEMUSAGE_METHOD) {
|
||||
auto method_info = dts.ts.lookup_method("object", method_id);
|
||||
if (method_id != GOAL_NEW_METHOD && method_id != GOAL_RELOC_METHOD) {
|
||||
// this can get us the wrong thing for `new` methods. And maybe relocate?
|
||||
return TP_Type::make_non_virtual_method(
|
||||
method_info.type.substitute_for_method_call("object"), TypeSpec("object"), method_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user