delay callable errors in control predicates (#1282)

This commit is contained in:
Mark Thom
2022-02-17 20:26:30 -07:00
parent 5b829636cb
commit 55d8de1b23
3 changed files with 117 additions and 61 deletions

View File

@@ -3929,20 +3929,24 @@ impl Machine {
let semicolon_second_clause_p = unsafe {
LOC_INIT.call_once(|| {
match self.indices.code_dir.get(&(atom!(";"), 2)).map(|cell| cell.get()) {
Some(IndexPtr::Index(p)) => {
match &self.code[p] {
&Instruction::TryMeElse(o) => {
SEMICOLON_SECOND_BRANCH_LOC = p + o;
}
_ => {
unreachable!();
if let Some(builtins) = self.indices.modules.get(&atom!("builtins")) {
match builtins.code_dir.get(&(atom!("staggered_sc"), 2)).map(|cell| cell.get()) {
Some(IndexPtr::Index(p)) => {
match &self.code[p] {
&Instruction::TryMeElse(o) => {
SEMICOLON_SECOND_BRANCH_LOC = p + o;
}
_ => {
unreachable!();
}
}
}
_ => {
unreachable!();
}
}
_ => {
unreachable!();
}
} else {
unreachable!();
}
});