diff options
Diffstat (limited to 'src/lj_ccallback.c')
-rw-r--r-- | src/lj_ccallback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c index bef379a5..5fe63a76 100644 --- a/src/lj_ccallback.c +++ b/src/lj_ccallback.c | |||
@@ -411,6 +411,7 @@ static void callback_conv_args(CTState *cts, lua_State *L) | |||
411 | int gcsteps = 0; | 411 | int gcsteps = 0; |
412 | CType *ct; | 412 | CType *ct; |
413 | GCfunc *fn; | 413 | GCfunc *fn; |
414 | int fntp; | ||
414 | MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR; | 415 | MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR; |
415 | #if CCALL_NARG_FPR | 416 | #if CCALL_NARG_FPR |
416 | MSize nfpr = 0; | 417 | MSize nfpr = 0; |
@@ -423,15 +424,17 @@ static void callback_conv_args(CTState *cts, lua_State *L) | |||
423 | ct = ctype_get(cts, id); | 424 | ct = ctype_get(cts, id); |
424 | rid = ctype_cid(ct->info); | 425 | rid = ctype_cid(ct->info); |
425 | fn = funcV(lj_tab_getint(cts->miscmap, (int32_t)slot)); | 426 | fn = funcV(lj_tab_getint(cts->miscmap, (int32_t)slot)); |
427 | fntp = LJ_TFUNC; | ||
426 | } else { /* Must set up frame first, before throwing the error. */ | 428 | } else { /* Must set up frame first, before throwing the error. */ |
427 | ct = NULL; | 429 | ct = NULL; |
428 | rid = 0; | 430 | rid = 0; |
429 | fn = (GCfunc *)L; | 431 | fn = (GCfunc *)L; |
432 | fntp = LJ_TTHREAD; | ||
430 | } | 433 | } |
431 | o->u32.lo = LJ_CONT_FFI_CALLBACK; /* Continuation returns from callback. */ | 434 | o->u32.lo = LJ_CONT_FFI_CALLBACK; /* Continuation returns from callback. */ |
432 | o->u32.hi = rid; /* Return type. x86: +(spadj<<16). */ | 435 | o->u32.hi = rid; /* Return type. x86: +(spadj<<16). */ |
433 | o++; | 436 | o++; |
434 | setframe_gc(o, obj2gco(fn)); | 437 | setframe_gc(o, obj2gco(fn), fntp); |
435 | setframe_ftsz(o, ((char *)(o+1) - (char *)L->base) + FRAME_CONT); | 438 | setframe_ftsz(o, ((char *)(o+1) - (char *)L->base) + FRAME_CONT); |
436 | L->top = L->base = ++o; | 439 | L->top = L->base = ++o; |
437 | if (!ct) | 440 | if (!ct) |