diff options
Diffstat (limited to 'src/lj_ccall.c')
-rw-r--r-- | src/lj_ccall.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lj_ccall.c b/src/lj_ccall.c index c1c04b6f..5ed1bf5b 100644 --- a/src/lj_ccall.c +++ b/src/lj_ccall.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include "lj_gc.h" | 10 | #include "lj_gc.h" |
11 | #include "lj_err.h" | 11 | #include "lj_err.h" |
12 | #include "lj_str.h" | 12 | #include "lj_str.h" |
13 | #include "lj_tab.h" | ||
13 | #include "lj_ctype.h" | 14 | #include "lj_ctype.h" |
14 | #include "lj_cconv.h" | 15 | #include "lj_cconv.h" |
15 | #include "lj_cdata.h" | 16 | #include "lj_cdata.h" |
@@ -290,7 +291,7 @@ | |||
290 | } | 291 | } |
291 | 292 | ||
292 | #else | 293 | #else |
293 | #error "missing calling convention definitions for this architecture" | 294 | #error "Missing calling convention definitions for this architecture" |
294 | #endif | 295 | #endif |
295 | 296 | ||
296 | #ifndef CCALL_HANDLE_STRUCTRET2 | 297 | #ifndef CCALL_HANDLE_STRUCTRET2 |
@@ -649,7 +650,13 @@ int lj_ccall_func(lua_State *L, GCcdata *cd) | |||
649 | int gcsteps, ret; | 650 | int gcsteps, ret; |
650 | cc.func = (void (*)(void))cdata_getptr(cdataptr(cd), sz); | 651 | cc.func = (void (*)(void))cdata_getptr(cdataptr(cd), sz); |
651 | gcsteps = ccall_set_args(L, cts, ct, &cc); | 652 | gcsteps = ccall_set_args(L, cts, ct, &cc); |
653 | cts->cb.slot = ~0u; | ||
652 | lj_vm_ffi_call(&cc); | 654 | lj_vm_ffi_call(&cc); |
655 | if (cts->cb.slot != ~0u) { /* Blacklist function that called a callback. */ | ||
656 | TValue tv; | ||
657 | setlightudV(&tv, (void *)cc.func); | ||
658 | setboolV(lj_tab_set(L, cts->miscmap, &tv), 1); | ||
659 | } | ||
653 | gcsteps += ccall_get_results(L, cts, ct, &cc, &ret); | 660 | gcsteps += ccall_get_results(L, cts, ct, &cc, &ret); |
654 | #if LJ_TARGET_X86 && LJ_ABI_WIN | 661 | #if LJ_TARGET_X86 && LJ_ABI_WIN |
655 | /* Automatically detect __stdcall and fix up C function declaration. */ | 662 | /* Automatically detect __stdcall and fix up C function declaration. */ |