Update ceval.c

This commit is contained in:
blueloveTH 2026-04-29 13:49:29 +08:00
parent 811755f924
commit fbc157a41c

View File

@ -539,11 +539,15 @@ __NEXT_STEP:
DISPATCH(); DISPATCH();
} }
case OP_BUILD_TUPLE: { case OP_BUILD_TUPLE: {
bool need_track = false;
py_TValue tmp; py_TValue tmp;
py_Ref p = py_newtuple(&tmp, byte.arg); py_Ref p = py_newtuple(&tmp, byte.arg);
py_TValue* begin = SP() - byte.arg; py_TValue* begin = SP() - byte.arg;
for(int i = 0; i < byte.arg; i++) for(int i = 0; i < byte.arg; i++) {
p[i] = begin[i]; p[i] = begin[i];
if(p[i].is_ptr) need_track = true;
}
if(!need_track) tmp._obj->gc_marked |= 0b10;
SP() = begin; SP() = begin;
PUSH(&tmp); PUSH(&tmp);
DISPATCH(); DISPATCH();