GH-112354: _GUARD_IS_TRUE_POP side-exits to target the next instruction, not themselves. (GH-114078)

This commit is contained in:
Mark Shannon 2024-01-15 11:41:06 +00:00 committed by GitHub
parent 2010d45327
commit ac10947ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 26 deletions

View file

@ -124,7 +124,7 @@ def replace_decrefs(
out.emit(f"Py_DECREF({var.name});\n")
def replace_store_sp(
def replace_sync_sp(
out: CWriter,
tkn: Token,
tkn_iter: Iterator[Token],
@ -135,9 +135,7 @@ def replace_store_sp(
next(tkn_iter)
next(tkn_iter)
next(tkn_iter)
out.emit_at("", tkn)
stack.flush(out)
out.emit("_PyFrame_SetStackPointer(frame, stack_pointer);\n")
def replace_check_eval_breaker(
@ -160,7 +158,7 @@ REPLACEMENT_FUNCTIONS = {
"ERROR_IF": replace_error,
"DECREF_INPUTS": replace_decrefs,
"CHECK_EVAL_BREAKER": replace_check_eval_breaker,
"STORE_SP": replace_store_sp,
"SYNC_SP": replace_sync_sp,
}
ReplacementFunctionType = Callable[