mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
add exception id to invoke/rethrow
This commit is contained in:
parent
3636e18a18
commit
64576ddab5
8 changed files with 101 additions and 92 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue