From 557f36fcff7efe6c4470d5ce25afc2b762b72336 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Sun, 10 Sep 2023 20:29:48 +0100 Subject: [PATCH] use intr_ptr in INSTRUMENTED_RESUME --- Python/bytecodes.c | 6 +++--- Python/generated_cases.c.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 0efbb36cede93b..c7d7842a938c97 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -183,10 +183,10 @@ dummy_func( tstate, oparg > 0, frame, next_instr-1); stack_pointer = _PyFrame_GetStackPointer(frame); ERROR_IF(err, error); - if (frame->prev_instr != next_instr-1) { + assert(frame->prev_instr == frame->instr_ptr); + if (frame->instr_ptr != next_instr-1) { /* Instrumentation has jumped */ - next_instr = frame->prev_instr; - frame->instr_ptr = next_instr; + next_instr = frame->instr_ptr; DISPATCH(); } } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index eba85bdf2761e6..c205d4f4fc202a 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -58,10 +58,10 @@ tstate, oparg > 0, frame, next_instr-1); stack_pointer = _PyFrame_GetStackPointer(frame); if (err) goto error; - if (frame->prev_instr != next_instr-1) { + assert(frame->prev_instr == frame->instr_ptr); + if (frame->instr_ptr != next_instr-1) { /* Instrumentation has jumped */ - next_instr = frame->prev_instr; - frame->instr_ptr = next_instr; + next_instr = frame->instr_ptr; DISPATCH(); } }