GH-128682: Account for escapes in DECREF_INPUTS (GH-129953)

* Handle escapes in DECREF_INPUTS

* Mark a few more functions as escaping

* Replace DECREF_INPUTS with PyStackRef_CLOSE where possible
This commit is contained in:
Mark Shannon 2025-02-12 17:44:59 +00:00 committed by GitHub
parent 3e222e3a15
commit 72f56654d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 2228 additions and 921 deletions

View file

@ -154,11 +154,11 @@ def write_uop(
var.defined = False
storage = emitter.emit_tokens(override, storage, None)
out.start_line()
storage.flush(out, cast_type="JitOptSymbol *")
storage.flush(out)
else:
emit_default(out, uop, stack)
out.start_line()
stack.flush(out, cast_type="JitOptSymbol *")
stack.flush(out)
except StackError as ex:
raise analysis_error(ex.args[0], prototype.body[0]) # from None
@ -201,7 +201,7 @@ def generate_abstract_interpreter(
declare_variables(override, out, skip_inputs=False)
else:
declare_variables(uop, out, skip_inputs=True)
stack = Stack(False)
stack = Stack(extract_bits=False, cast_type="JitOptSymbol *")
write_uop(override, uop, out, stack, debug, skip_inputs=(override is None))
out.start_line()
out.emit("break;\n")