Skip to content

Commit f0b3243

Browse files
authored
Fix disassemblify for programs without explicit trap at the end. (#221)
1 parent ddaa061 commit f0b3243

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/ProgramLoader/Assembly.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ function assemblyFromInputProgram(initialState: InitialState, program: number[])
6262
l = l.replace(/^(.*)\/\/.*/, "$1");
6363
// fix unary minus
6464
l = l.replace(/= -/, "= 0 -");
65+
// replace `invalid` instructions with a comment
66+
l = l.replace("invalid", "// invalid");
6567
return l;
6668
});
6769

0 commit comments

Comments
 (0)