]> git.mxchange.org Git - simgear.git/commitdiff
Nasal: use correct function pointer in naCall (with user data)
authorThomas Geymayer <tomgey@gmail.com>
Tue, 15 Oct 2013 12:21:45 +0000 (14:21 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 15 Oct 2013 12:21:45 +0000 (14:21 +0200)
simgear/nasal/code.c

index 395a3cdd99ddd9e96153b6556a2d6ff70055006b..d1da92a3ef62f4ebb8c51b3f13044b38a5ac1676 100644 (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;
     }