Upvalue closing only needs to happen once in CLOSE_MANY

This commit is contained in:
K. Lange 2022-06-09 08:05:23 +09:00
parent 4b021181bd
commit 5e464b3d67

View File

@ -3061,8 +3061,8 @@ _finishReturn: (void)0;
THREE_BYTE_OPERAND;
case OP_CLOSE_MANY: {
ONE_BYTE_OPERAND;
closeUpvalues((krk_currentThread.stackTop - krk_currentThread.stack) - OPERAND);
for (int i = 0; i < OPERAND; ++i) {
closeUpvalues((krk_currentThread.stackTop - krk_currentThread.stack)-1);
krk_pop();
}
break;