Berry fix exceptions

This commit is contained in:
Stephan Hadinger 2021-12-12 19:58:14 +01:00
parent fa7b0302a7
commit 47deea04ce
2 changed files with 13 additions and 0 deletions

View File

@ -1062,7 +1062,13 @@ newframe: /* a new call frame */
if (!IGET_RA(ins)) {
be_except_block_setup(vm);
if (be_setjmp(vm->errjmp->b)) {
bvalue *top = vm->top;
bvalue e1 = top[0];
bvalue e2 = top[1];
be_except_block_resume(vm);
top = vm->top;
top[0] = e1;
top[1] = e2;
goto newframe;
}
reg = vm->reg;

View File

@ -0,0 +1,7 @@
try
for k: 0..1 assert({'a':1}.contains('b'), 'failure') end
except .. as e,m
assert(e == "assert_failed")
assert(m == "failure")
end