diff options
author | Mike Pall <mike> | 2012-04-12 14:21:41 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-04-12 14:21:41 +0200 |
commit | cf5a54fedf35ee76d0e8b610f5e695cc3b7b961b (patch) | |
tree | 8645368fd6f0a9730739f36a023ede005a1129b6 | |
parent | 68ca796d28f616f38a376ed1bb1a3de29d1b1200 (diff) | |
download | luajit-cf5a54fedf35ee76d0e8b610f5e695cc3b7b961b.tar.gz luajit-cf5a54fedf35ee76d0e8b610f5e695cc3b7b961b.tar.bz2 luajit-cf5a54fedf35ee76d0e8b610f5e695cc3b7b961b.zip |
FFI: Fix blacklisting of C functions calling callbacks.
-rw-r--r-- | src/lj_ccallback.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c index 8e89bc6c..482553f0 100644 --- a/src/lj_ccallback.c +++ b/src/lj_ccallback.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "lj_ccallback.h" | 18 | #include "lj_ccallback.h" |
19 | #include "lj_target.h" | 19 | #include "lj_target.h" |
20 | #include "lj_mcode.h" | 20 | #include "lj_mcode.h" |
21 | #include "lj_trace.h" | ||
21 | #include "lj_vm.h" | 22 | #include "lj_vm.h" |
22 | 23 | ||
23 | /* -- Target-specific handling of callback slots -------------------------- */ | 24 | /* -- Target-specific handling of callback slots -------------------------- */ |
@@ -486,6 +487,7 @@ lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) | |||
486 | lua_assert(L != NULL); | 487 | lua_assert(L != NULL); |
487 | if (gcref(cts->g->jit_L)) | 488 | if (gcref(cts->g->jit_L)) |
488 | lj_err_caller(gco2th(gcref(cts->g->jit_L)), LJ_ERR_FFI_BADCBACK); | 489 | lj_err_caller(gco2th(gcref(cts->g->jit_L)), LJ_ERR_FFI_BADCBACK); |
490 | lj_trace_abort(cts->g); /* Never record across callback. */ | ||
489 | /* Setup C frame. */ | 491 | /* Setup C frame. */ |
490 | cframe_prev(cf) = L->cframe; | 492 | cframe_prev(cf) = L->cframe; |
491 | setcframe_L(cf, L); | 493 | setcframe_L(cf, L); |
@@ -516,6 +518,7 @@ void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o) | |||
516 | L->cframe = cframe_prev(L->cframe); | 518 | L->cframe = cframe_prev(L->cframe); |
517 | L->top -= 2; | 519 | L->top -= 2; |
518 | L->base = obase; | 520 | L->base = obase; |
521 | cts->cb.slot = 0; /* Blacklist C function that called the callback. */ | ||
519 | } | 522 | } |
520 | 523 | ||
521 | /* -- C callback management ----------------------------------------------- */ | 524 | /* -- C callback management ----------------------------------------------- */ |