summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-07-18 16:00:41 (GMT)
committerGitHub <noreply@github.com>2022-07-18 16:00:41 (GMT)
commitb407312a24f12de76a928394099decd64f6049a6 (patch)
tree2f127bd9c3b9ea2e1febccbb8ef9e8fc7b507cde /Objects/frameobject.c
parent067f0da33506f70c36a67d5f3d8d011c8dae10c9 (diff)
downloadcpython-b407312a24f12de76a928394099decd64f6049a6.zip
cpython-b407312a24f12de76a928394099decd64f6049a6.tar.gz
cpython-b407312a24f12de76a928394099decd64f6049a6.tar.bz2
GH-94893: Ignore caches when adding LOAD_FAST_CHECKs (GH-94894)
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 3e97b75..fe8eaa3 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -603,7 +603,8 @@ add_load_fast_null_checks(PyCodeObject *co)
int changed = 0;
_Py_CODEUNIT *instructions = _PyCode_CODE(co);
for (Py_ssize_t i = 0; i < Py_SIZE(co); i++) {
- switch (_Py_OPCODE(instructions[i])) {
+ int opcode = _Py_OPCODE(instructions[i]);
+ switch (opcode) {
case LOAD_FAST:
case LOAD_FAST__LOAD_FAST:
case LOAD_FAST__LOAD_CONST:
@@ -619,6 +620,7 @@ add_load_fast_null_checks(PyCodeObject *co)
_Py_SET_OPCODE(instructions[i], STORE_FAST);
break;
}
+ i += _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
}
if (changed) {
// invalidate cached co_code object