Close upvalues even if exception exits runtime

This commit is contained in:
K. Lange 2022-07-24 14:05:22 +09:00
parent ee86a241e0
commit 8213430712

View File

@ -1768,6 +1768,7 @@ static int handleException() {
krk_currentThread.frameCount = krk_currentThread.exitOnFrame;
/* Ensure stack is in the expected place, as if we returned None. */
closeUpvalues(exitSlot);
krk_currentThread.stackTop = &krk_currentThread.stack[exitSlot];
/* If exitSlot was not 0, there was an exception during a call to runNext();