diff options
author | Mike Pall <mike> | 2012-10-21 19:15:03 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-10-21 19:17:14 +0200 |
commit | 1d5c2ce4e295562daddfe6ce8e470749f0d42542 (patch) | |
tree | e56ef2c9b51a466654548bb52a0ebaf7f9cb6e3d /src | |
parent | f6536c6696deca9fb7b9744573406c83f0f893a4 (diff) | |
download | luajit-1d5c2ce4e295562daddfe6ce8e470749f0d42542.tar.gz luajit-1d5c2ce4e295562daddfe6ce8e470749f0d42542.tar.bz2 luajit-1d5c2ce4e295562daddfe6ce8e470749f0d42542.zip |
Replace error with PANIC for callbacks from JIT-compiled code.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_ccallback.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c index 430643ee..e1d03fcf 100644 --- a/src/lj_ccallback.c +++ b/src/lj_ccallback.c | |||
@@ -527,10 +527,14 @@ static void callback_conv_result(CTState *cts, lua_State *L, TValue *o) | |||
527 | lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) | 527 | lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) |
528 | { | 528 | { |
529 | lua_State *L = cts->L; | 529 | lua_State *L = cts->L; |
530 | global_State *g = cts->g; | ||
530 | lua_assert(L != NULL); | 531 | lua_assert(L != NULL); |
531 | if (gcref(cts->g->jit_L)) | 532 | if (gcref(g->jit_L)) { |
532 | lj_err_caller(gco2th(gcref(cts->g->jit_L)), LJ_ERR_FFI_BADCBACK); | 533 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK)); |
533 | lj_trace_abort(cts->g); /* Never record across callback. */ | 534 | if (g->panic) g->panic(L); |
535 | exit(EXIT_FAILURE); | ||
536 | } | ||
537 | lj_trace_abort(g); /* Never record across callback. */ | ||
534 | /* Setup C frame. */ | 538 | /* Setup C frame. */ |
535 | cframe_prev(cf) = L->cframe; | 539 | cframe_prev(cf) = L->cframe; |
536 | setcframe_L(cf, L); | 540 | setcframe_L(cf, L); |