From: Mark Thom Date: Wed, 5 May 2021 17:16:33 +0000 (-0600) Subject: add missing default RevJmpBy arm to thread_choice_instr_at_to (prompted by #922) X-Git-Tag: v0.9.0~86 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=b968b2c43810a0dff14007d1517622edb43a1de7;p=scryer-prolog.git add missing default RevJmpBy arm to thread_choice_instr_at_to (prompted by #922) --- diff --git a/src/machine/compile.rs b/src/machine/compile.rs index e88dc605..b0242aac 100644 --- a/src/machine/compile.rs +++ b/src/machine/compile.rs @@ -682,6 +682,9 @@ fn thread_choice_instr_at_to( *o = instr_loc - target_loc; return; } + &mut Line::Control(ControlInstruction::RevJmpBy(o)) => { + instr_loc -= o; + } &mut Line::Choice(ChoiceInstruction::DynamicElse(birth, death, ref mut fail)) if target_loc >= instr_loc => { @@ -733,12 +736,6 @@ fn thread_choice_instr_at_to( instr_loc += *o; } _ => { - println!("failing code: \n"); - - for index in instr_loc - 40..instr_loc + 40 { - println!("{:07} | {}", index, code[index]); - } - unreachable!() } }