Merge pull request #14022 from s-hadinger/berry_fix_exceptions

Berry fix exceptions
This commit is contained in:
s-hadinger 2021-12-12 21:08:43 +01:00 committed by GitHub
commit 0386a0d74b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -1060,7 +1060,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