diff options
author | Mark Shannon <mark@hotpy.org> | 2023-06-19 09:32:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 09:32:20 (GMT) |
commit | 581619941ecce986a2fc8cbddd95256daa25fb26 (patch) | |
tree | 4531fd801297edeed79d2ce6dcba28117ff9dafc /Python/bytecodes.c | |
parent | 4426279a4399158027a1145cff1c4c92424bf5b5 (diff) | |
download | cpython-581619941ecce986a2fc8cbddd95256daa25fb26.zip cpython-581619941ecce986a2fc8cbddd95256daa25fb26.tar.gz cpython-581619941ecce986a2fc8cbddd95256daa25fb26.tar.bz2 |
GH-104584: Assorted fixes for the optimizer API. (GH-105683)
* Add test for long loops
* Clear ENTER_EXECUTOR when deopting code objects.
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index a2cb834..a7acff6 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2157,6 +2157,7 @@ dummy_func( frame = cframe.current_frame; goto error; } + assert(frame == cframe.current_frame); here[1].cache &= ((1 << OPTIMIZER_BITS_IN_COUNTER) -1); goto resume_frame; } @@ -2176,7 +2177,7 @@ dummy_func( inst(ENTER_EXECUTOR, (--)) { PyCodeObject *code = _PyFrame_GetCode(frame); - _PyExecutorObject *executor = (_PyExecutorObject *)code->co_executors->executors[oparg]; + _PyExecutorObject *executor = (_PyExecutorObject *)code->co_executors->executors[oparg&255]; Py_INCREF(executor); frame = executor->execute(executor, frame, stack_pointer); if (frame == NULL) { |