Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an issue where frame object manipulations could corrupt inline bytecode
caches.
4 changes: 3 additions & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,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:
Expand All @@ -509,6 +510,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
Expand Down