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:
andy
2005-05-04 20:17:28 +00:00
parent dea7b9050d
commit 1a72245c15

View File

@@ -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;