From cf5a54fedf35ee76d0e8b610f5e695cc3b7b961b Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Thu, 12 Apr 2012 14:21:41 +0200 Subject: [PATCH] FFI: Fix blacklisting of C functions calling callbacks. --- src/lj_ccallback.c | 3 +++ 1 file changed, 3 insertions(+) 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 @@ #include "lj_ccallback.h" #include "lj_target.h" #include "lj_mcode.h" +#include "lj_trace.h" #include "lj_vm.h" /* -- Target-specific handling of callback slots -------------------------- */ @@ -486,6 +487,7 @@ lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) lua_assert(L != NULL); if (gcref(cts->g->jit_L)) lj_err_caller(gco2th(gcref(cts->g->jit_L)), LJ_ERR_FFI_BADCBACK); + lj_trace_abort(cts->g); /* Never record across callback. */ /* Setup C frame. */ cframe_prev(cf) = L->cframe; setcframe_L(cf, L); @@ -516,6 +518,7 @@ void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o) L->cframe = cframe_prev(L->cframe); L->top -= 2; L->base = obase; + cts->cb.slot = 0; /* Blacklist C function that called the callback. */ } /* -- C callback management ----------------------------------------------- */