Skip to content

PS2 games in the browser: static recompilation to WebAssembly with a native runtime

C++

eerecomp: continue past the delay slot when a branch ends a unit

Samir Nuri5f60c898de05
diff --git a/recomp/codegen.cpp b/recomp/codegen.cpp
index 8254154..7a49f47 100644
--- a/recomp/codegen.cpp
+++ b/recomp/codegen.cpp
@@ -219,7 +219,7 @@ private:
control(i, ds);
falls = fl != Flow::Jump && fl != Flow::JumpRegister;
skip = true;
- if (falls && labels_.count(a + 4)) {
+ if (falls && (labels_.count(a + 4) || !in_unit(a + 4))) {
if (in_unit(a + 8)) line("goto " + label(a + 8) + ";");
else exit_to(a + 8);
falls = false;