mirror of
https://github.com/open-goal/jak-project
synced 2026-08-13 04:10:18 -04:00
Clean up some errors/crashes in decompiler (#452)
* fix offline tests, clean up some warnings * clean up warnings during decomp * fix remaining crash issues
This commit is contained in:
@@ -324,8 +324,6 @@ goos::Object decompile_structure(const TypeSpec& type,
|
||||
// we can specify a more specific type.
|
||||
auto got_type = TypeSpec(word.symbol_name);
|
||||
if (ts.tc(actual_type, got_type)) {
|
||||
lg::info("For type {}, got more specific type {}\n", actual_type.print(),
|
||||
got_type.print());
|
||||
actual_type = got_type;
|
||||
if (actual_type == TypeSpec("string")) {
|
||||
return decompile_string_at_label(label, words);
|
||||
@@ -601,7 +599,7 @@ goos::Object decompile_value(const TypeSpec& type,
|
||||
assert(bytes.size() == 4);
|
||||
s32 value;
|
||||
memcpy(&value, bytes.data(), 4);
|
||||
if (value > 100 && value <= INT32_MAX) {
|
||||
if (value > 100) {
|
||||
return pretty_print::to_symbol(fmt::format("#x{:x}", value));
|
||||
} else {
|
||||
return pretty_print::to_symbol(fmt::format("{}", value));
|
||||
@@ -615,7 +613,7 @@ goos::Object decompile_value(const TypeSpec& type,
|
||||
assert(bytes.size() == 2);
|
||||
s16 value;
|
||||
memcpy(&value, bytes.data(), 2);
|
||||
if (value > 100 && value <= INT16_MAX) {
|
||||
if (value > 100) {
|
||||
return pretty_print::to_symbol(fmt::format("#x{:x}", value));
|
||||
} else {
|
||||
return pretty_print::to_symbol(fmt::format("{}", value));
|
||||
|
||||
Reference in New Issue
Block a user