Don't ignore non-void returns

This commit is contained in:
Yoshi Askharoun
2025-07-21 02:26:32 -05:00
parent 27b248c704
commit eb7e5f6f0b
2 changed files with 7 additions and 2 deletions
+5 -2
View File
@@ -55,8 +55,6 @@ partial class Decompiler
// End of function
if (i + 1 != methodBody.Length)
throw new InvalidOperationException("Expected end of function!");
break;
}
}
@@ -186,6 +184,11 @@ partial class Decompiler
);
break;
case OpCode.ReturnValue:
var returnStatement = ReturnStatement(IrisExpression.ToSyntax(stack.Pop(), _context));
blockStack.Peek().Statements.Add(returnStatement);
break;
case not OpCode.ReturnVoid:
if (!TryDecompileExpression(instruction, stack, blockStack))
{
+2
View File
@@ -850,12 +850,14 @@
{
// Unsupported instruction: CSYM 63
;
return source;
} // TODO: JMP 170
}// Unsupported instruction: VTC 960
;
source = FrameBackgrounds.get_Item(DefaultBackgroundIndex).Value;
// Unsupported instruction: CSYM 63
;
return source;
}</Script>
</Scripts>
</Class>