Properly release the mod lock when returning from a runtime error.
Ampere discovered that the interpreter would deadlock at runtime if it hit such a condition during initialization.
This commit is contained in:
@@ -678,8 +678,10 @@ naRef naCall(naContext ctx, naRef func, naRef args, naRef obj, naRef locals)
|
||||
// Return early if an error occurred. It will be visible to the
|
||||
// caller via naGetError().
|
||||
ctx->error = 0;
|
||||
if(setjmp(ctx->jumpHandle))
|
||||
if(setjmp(ctx->jumpHandle)) {
|
||||
if(!ctx->callParent) naModUnlock(ctx);
|
||||
return naNil();
|
||||
}
|
||||
|
||||
if(IS_CCODE(func.ref.ptr.func->code)) {
|
||||
naCFunction fp = func.ref.ptr.func->code.ref.ptr.ccode->fptr;
|
||||
|
||||
Reference in New Issue
Block a user