Fix incorrect OP_CLOSURE instruction size returned by dis.examine

This commit is contained in:
K. Lange 2022-06-03 13:07:49 +09:00
parent 9c25e200b8
commit 5a79f27b83

View File

@ -633,13 +633,15 @@ KRK_FUNC(build,{
size = 3; break; }
#define CLOSURE_MORE \
KrkCodeObject * function = AS_codeobject(chunk->constants.values[constant]); \
size_t baseOffset = offset; \
for (size_t j = 0; j < function->upvalueCount; ++j) { \
int isLocal = chunk->code[offset++ + size]; \
offset++; \
int isLocal = chunk->code[baseOffset++ + size]; \
baseOffset++; \
if (isLocal & 2) { \
offset += 2; \
baseOffset += 2; \
} \
}
} \
size += baseOffset - offset;
#define EXPAND_ARGS_MORE
#define LOCAL_MORE local = operand;
static KrkValue _examineInternal(KrkCodeObject* func) {