mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
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:
parent
3e222e3a15
commit
72f56654d0
18 changed files with 2228 additions and 921 deletions
|
|
@ -1723,6 +1723,7 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
input = """
|
||||
inst(BALANCED, ( -- )) {
|
||||
SAVE_STACK();
|
||||
code();
|
||||
RELOAD_STACK();
|
||||
}
|
||||
"""
|
||||
|
|
@ -1737,12 +1738,36 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
next_instr += 1;
|
||||
INSTRUCTION_STATS(BALANCED);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
code();
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_stack_save_reload_paired(self):
|
||||
|
||||
input = """
|
||||
inst(BALANCED, ( -- )) {
|
||||
SAVE_STACK();
|
||||
RELOAD_STACK();
|
||||
}
|
||||
"""
|
||||
|
||||
output = """
|
||||
TARGET(BALANCED) {
|
||||
#if defined(Py_TAIL_CALL_INTERP)
|
||||
int opcode = BALANCED;
|
||||
(void)(opcode);
|
||||
#endif
|
||||
frame->instr_ptr = next_instr;
|
||||
next_instr += 1;
|
||||
INSTRUCTION_STATS(BALANCED);
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_stack_reload_only(self):
|
||||
|
||||
input = """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue