mirror of
https://gitlab.cs.washington.edu/fidelp/frustration.git
synced 2024-11-16 07:48:10 +01:00
fixed missing RETs, added sensible termination case
This commit is contained in:
parent
b1a477ea99
commit
f2d9b7a092
1 changed files with 5 additions and 1 deletions
|
@ -94,6 +94,7 @@ fn init_dictionary(c: &mut Core) {
|
||||||
for p in PRIMITIVES {
|
for p in PRIMITIVES {
|
||||||
create(c, p.name);
|
create(c, p.name);
|
||||||
comma(c, opcode);
|
comma(c, opcode);
|
||||||
|
comma(c, 65535); // ret
|
||||||
opcode -= 1;
|
opcode -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,8 +143,11 @@ fn step(c: &mut Core) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn inner(c: &mut Core) {
|
fn inner(c: &mut Core) {
|
||||||
while c.ip != 2 {
|
loop {
|
||||||
step(c);
|
step(c);
|
||||||
|
if c.trs == 0 {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue