Skip to content

Commit

Permalink
fix default register value error
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Dec 20, 2024
1 parent a518d0f commit 0cecbb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/engine/src/bytecompiler/statement/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ impl ByteCompiler<'_> {
let variant = match (t.catch(), t.finally()) {
(Some(catch), Some(finally)) => {
let finally_re_throw = self.register_allocator.alloc();
self.push_true(&finally_re_throw);
self.push_try_with_finally_control_info(&finally_re_throw, use_expr);
TryVariant::CatchFinally((catch, finally, finally_re_throw))
}
(Some(catch), None) => TryVariant::Catch(catch),
(None, Some(finally)) => {
let finally_re_throw = self.register_allocator.alloc();
self.push_true(&finally_re_throw);
self.push_try_with_finally_control_info(&finally_re_throw, use_expr);
TryVariant::Finally((finally, finally_re_throw))
}
Expand Down

0 comments on commit 0cecbb6

Please sign in to comment.