GH-128375: Better instrument for FOR_ITER (GH-128445)

This commit is contained in:
Mark Shannon 2025-01-06 17:54:47 +00:00 committed by GitHub
parent b9c693dcca
commit f826beca0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 827 additions and 544 deletions

View file

@ -411,6 +411,20 @@
break;
}
case _END_FOR: {
_PyStackRef value;
value = stack_pointer[-1];
/* Don't update instr_ptr, so that POP_ITER sees
* the FOR_ITER as the previous instruction.
* This has the benign side effect that if value is
* finalized it will see the location as the FOR_ITER's.
*/
PyStackRef_CLOSE(value);
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
break;
}
case _END_SEND: {
_PyStackRef value;
_PyStackRef receiver;