diff options
| -rw-r--r-- | src/lj_snap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 8efe37fd..b6a02f6f 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
| @@ -311,8 +311,10 @@ static BCReg snap_usedef(jit_State *J, uint8_t *udf, | |||
| 311 | void lj_snap_purge(jit_State *J) | 311 | void lj_snap_purge(jit_State *J) |
| 312 | { | 312 | { |
| 313 | uint8_t udf[SNAP_USEDEF_SLOTS]; | 313 | uint8_t udf[SNAP_USEDEF_SLOTS]; |
| 314 | BCReg maxslot = J->maxslot; | 314 | BCReg s, maxslot = J->maxslot; |
| 315 | BCReg s = snap_usedef(J, udf, J->pc, maxslot); | 315 | if (bc_op(*J->pc) == BC_FUNCV && maxslot > J->pt->numparams) |
| 316 | maxslot = J->pt->numparams; | ||
| 317 | s = snap_usedef(J, udf, J->pc, maxslot); | ||
| 316 | for (; s < maxslot; s++) | 318 | for (; s < maxslot; s++) |
| 317 | if (udf[s] != 0) | 319 | if (udf[s] != 0) |
| 318 | J->base[s] = 0; /* Purge dead slots. */ | 320 | J->base[s] = 0; /* Purge dead slots. */ |
