add exception id to invoke/rethrow

This commit is contained in:
Folkert 2021-05-29 23:00:28 +02:00
parent 3636e18a18
commit 64576ddab5
8 changed files with 101 additions and 92 deletions

View file

@ -102,9 +102,10 @@ fn insert_jumps<'a>(
},
fail,
pass: Stmt::Ret(rsym),
exception_id,
..
} if needle == *fsym && symbol == rsym => {
debug_assert_eq!(fail, &&Stmt::Rethrow);
debug_assert_eq!(fail, &&Stmt::Rethrow(*exception_id));
// replace the call and return with a jump
@ -131,6 +132,7 @@ fn insert_jumps<'a>(
fail,
pass,
layout,
exception_id,
} => {
let opt_pass = insert_jumps(arena, pass, goal_id, needle);
let opt_fail = insert_jumps(arena, fail, goal_id, needle);
@ -145,6 +147,7 @@ fn insert_jumps<'a>(
layout: *layout,
pass,
fail,
exception_id: *exception_id,
};
Some(arena.alloc(stmt))
@ -238,7 +241,7 @@ fn insert_jumps<'a>(
None => None,
},
Rethrow => None,
Rethrow(_) => None,
Ret(_) => None,
Jump(_, _) => None,
RuntimeError(_) => None,