mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
GH-94893: Ignore caches when adding LOAD_FAST_CHECKs (GH-94894)
This commit is contained in:
parent
067f0da335
commit
b407312a24
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue