summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2024-05-07 04:22:59 (GMT)
committerGitHub <noreply@github.com>2024-05-07 04:22:59 (GMT)
commit0d9148823dbb6af020945ab1b487d7f183b561a5 (patch)
tree1c365d6f0e96c9b722c1b885883183a19d1b0127 /Python
parentb2cd54a4fb2ecdb7b1d30bda8af3314d3a32031e (diff)
downloadcpython-0d9148823dbb6af020945ab1b487d7f183b561a5.zip
cpython-0d9148823dbb6af020945ab1b487d7f183b561a5.tar.gz
cpython-0d9148823dbb6af020945ab1b487d7f183b561a5.tar.bz2
gh-118414: Fix assertion in YIELD_VALUE when tracing lines or instrs (#118683)
Diffstat (limited to 'Python')
-rw-r--r--Python/bytecodes.c4
-rw-r--r--Python/executor_cases.c.h4
-rw-r--r--Python/generated_cases.c.h4
3 files changed, 9 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index b2ddec9..55eda97 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1121,7 +1121,9 @@ dummy_func(
/* We don't know which of these is relevant here, so keep them equal */
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
#if TIER_ONE
- assert(_PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
+ assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE ||
+ frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION ||
+ _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 5f15f67..347a1e6 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -1137,7 +1137,9 @@
/* We don't know which of these is relevant here, so keep them equal */
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
#if TIER_ONE
- assert(_PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
+ assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE ||
+ frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION ||
+ _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index d3126b0..8b81122 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -6223,7 +6223,9 @@
/* We don't know which of these is relevant here, so keep them equal */
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
#if TIER_ONE
- assert(_PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
+ assert(frame->instr_ptr->op.code == INSTRUMENTED_LINE ||
+ frame->instr_ptr->op.code == INSTRUMENTED_INSTRUCTION ||
+ _PyOpcode_Deopt[frame->instr_ptr->op.code] == SEND ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == FOR_ITER ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == INTERPRETER_EXIT ||
_PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);