diff options
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r-- | src/lj_gc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c index 2fc52ec1..6c3187c3 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "lj_trace.h" | 27 | #include "lj_trace.h" |
28 | #include "lj_dispatch.h" | 28 | #include "lj_dispatch.h" |
29 | #include "lj_vm.h" | 29 | #include "lj_vm.h" |
30 | #include "lj_vmevent.h" | ||
30 | 31 | ||
31 | #define GCSTEPSIZE 1024u | 32 | #define GCSTEPSIZE 1024u |
32 | #define GCSWEEPMAX 40 | 33 | #define GCSWEEPMAX 40 |
@@ -521,8 +522,13 @@ static void gc_call_finalizer(global_State *g, lua_State *L, | |||
521 | hook_restore(g, oldh); | 522 | hook_restore(g, oldh); |
522 | if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g); | 523 | if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g); |
523 | g->gc.threshold = oldt; /* Restore GC threshold. */ | 524 | g->gc.threshold = oldt; /* Restore GC threshold. */ |
524 | if (errcode) | 525 | if (errcode) { |
525 | lj_err_throw(L, errcode); /* Propagate errors. */ | 526 | ptrdiff_t errobj = savestack(L, L->top-1); /* Stack may be resized. */ |
527 | lj_vmevent_send(L, ERRFIN, | ||
528 | copyTV(L, L->top++, restorestack(L, errobj)); | ||
529 | ); | ||
530 | L->top--; | ||
531 | } | ||
526 | } | 532 | } |
527 | 533 | ||
528 | /* Finalize one userdata or cdata object from the mmudata list. */ | 534 | /* Finalize one userdata or cdata object from the mmudata list. */ |