Nasal: use correct function pointer in naCall (with user data)

This commit is contained in:
Thomas Geymayer
2013-10-15 14:21:45 +02:00
parent d68b1144b8
commit 8ca8052a8d

View File

@@ -874,8 +874,10 @@ naRef naCall(naContext ctx, naRef func, int argc, naRef* args,
}
if(IS_CCODE(PTR(func).func->code)) {
naCFunction fp = PTR(PTR(func).func->code).ccode->fptr;
result = (*fp)(ctx, obj, argc, args);
struct naCCode *ccode = PTR(PTR(func).func->code).ccode;
result = ccode->fptru
? (*ccode->fptru)(ctx, obj, argc, args, ccode->user_data)
: (*ccode->fptr) (ctx, obj, argc, args);
if(!ctx->callParent) naModUnlock();
return result;
}