Skip to content

Commit f9cf3db

Browse files
committed
Add a couple more comments.
1 parent b8d6799 commit f9cf3db

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Python/ceval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
801801
}
802802
if (_PyOpcode_Caches[original_opcode]) {
803803
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)(next_instr+1);
804+
/* Prevent the underlying instruction from specializing
805+
* and overwriting the instrumentation. */
804806
INCREMENT_ADAPTIVE_COUNTER(cache->counter);
805807
}
806808
opcode = original_opcode;

Python/instrumentation.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,9 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame,
11081108
int prev_line = _Py_Instrumentation_GetLine(code, prev_index);
11091109
if (prev_line == line) {
11101110
int prev_opcode = _PyCode_CODE(code)[prev_index].op.code;
1111+
/* RESUME and INSTRUMENTED_RESUME are needed for the operation of
1112+
* instrumentation, so must never be hidden by an INSTRUMENTED_LINE.
1113+
*/
11111114
if (prev_opcode != RESUME && prev_opcode != INSTRUMENTED_RESUME) {
11121115
goto done;
11131116
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy