From b9b02eeff69e77c230c9a4936eec780ef06ca48f Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 17 Apr 2023 14:43:24 -0700 Subject: [PATCH] Interpreter: hitting a Terminator::None returns as if a trap --- src/interp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interp.rs b/src/interp.rs index 628f93a..49ab317 100644 --- a/src/interp.rs +++ b/src/interp.rs @@ -227,7 +227,7 @@ impl InterpContext { } match &body.blocks[frame.cur_block].terminator { - &Terminator::None => unreachable!(), + &Terminator::None => return InterpResult::Trap, &Terminator::Unreachable => return InterpResult::Trap, &Terminator::Br { ref target } => { frame.apply_target(body, target);