GH-115419: Improve list of escaping functions (GH-118054)

This commit is contained in:
Mark Shannon 2024-04-19 09:25:07 +01:00 committed by GitHub
parent fefd5d9711
commit d3bd6b5f3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 25 deletions

View file

@ -543,7 +543,9 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
return pc + 1;
default:
{
bool needs_ip = false;
/* _PUSH_FRAME doesn't escape or error, but it
* does need the IP for the return address */
bool needs_ip = opcode == _PUSH_FRAME;
if (_PyUop_Flags[opcode] & HAS_ESCAPES_FLAG) {
needs_ip = true;
may_have_escaped = true;