diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -412,12 +412,12 @@ static void moveresults (lua_State *L, StkId res, int nres, int wanted) { | |||
412 | if (hastocloseCfunc(wanted)) { /* to-be-closed variables? */ | 412 | if (hastocloseCfunc(wanted)) { /* to-be-closed variables? */ |
413 | ptrdiff_t savedres = savestack(L, res); | 413 | ptrdiff_t savedres = savestack(L, res); |
414 | luaF_close(L, res, CLOSEKTOP, 0); /* may change the stack */ | 414 | luaF_close(L, res, CLOSEKTOP, 0); /* may change the stack */ |
415 | res = restorestack(L, savedres); | ||
416 | wanted = codeNresults(wanted); /* correct value */ | 415 | wanted = codeNresults(wanted); /* correct value */ |
417 | if (wanted == LUA_MULTRET) | 416 | if (wanted == LUA_MULTRET) |
418 | wanted = nres; | 417 | wanted = nres; |
419 | if (L->hookmask) /* if needed, call hook after '__close's */ | 418 | if (L->hookmask) /* if needed, call hook after '__close's */ |
420 | rethook(L, L->ci, nres); | 419 | rethook(L, L->ci, nres); |
420 | res = restorestack(L, savedres); /* close and hook can move stack */ | ||
421 | } | 421 | } |
422 | break; | 422 | break; |
423 | } | 423 | } |