mirror of
https://github.com/open-goal/jak-project
synced 2026-06-02 10:10:44 -04:00
[decompiler] fix bad cast and crash on bad and/or recognition (#626)
* fix small bugs * fix missing inlining of derefs
This commit is contained in:
@@ -537,6 +537,13 @@ bool try_splitting_nested_sc(FormPool& pool, Function& func, ShortCircuitElement
|
||||
assert(ir->entries.front().branch_delay.has_value());
|
||||
bool first_is_and = delay_slot_sets_false(first_branch.first, *ir->entries.front().branch_delay);
|
||||
bool first_is_or = delay_slot_sets_truthy(first_branch.first, *ir->entries.front().branch_delay);
|
||||
|
||||
if (first_is_and == first_is_or) {
|
||||
throw std::runtime_error(fmt::format(
|
||||
"Failed to split nested sc. This may mean that abs/ash/type-of was misrecognized as "
|
||||
"and/or:\n{}",
|
||||
ir->to_string(func.ir2.env)));
|
||||
}
|
||||
assert(first_is_and != first_is_or); // one or the other but not both!
|
||||
|
||||
int first_different = -1; // the index of the first one that's different.
|
||||
|
||||
Reference in New Issue
Block a user