From 8ca8052a8d7653f28ac376b4d7dce5f85b903be4 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Tue, 15 Oct 2013 14:21:45 +0200 Subject: [PATCH] Nasal: use correct function pointer in naCall (with user data) --- simgear/nasal/code.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simgear/nasal/code.c b/simgear/nasal/code.c index 395a3cdd..d1da92a3 100644 --- a/simgear/nasal/code.c +++ b/simgear/nasal/code.c @@ -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; } -- 2.39.5