There was an error while loading. Please reload this page.
1 parent 88f7beb commit c8877e4Copy full SHA for c8877e4
1 file changed
Objects/codeobject.c
@@ -1730,7 +1730,7 @@ identify_unbound_names(PyThreadState *tstate, PyCodeObject *co,
1730
assert(counts == NULL || counts->total == 0);
1731
struct co_unbound_counts unbound = {0};
1732
Py_ssize_t len = Py_SIZE(co);
1733
- for (int i = 0; i < len; i++) {
+ for (int i = 0; i < len; i += _PyInstruction_GetLength(co, i)) {
1734
_Py_CODEUNIT inst = _Py_GetBaseCodeUnit(co, i);
1735
if (inst.op.code == LOAD_ATTR) {
1736
int oparg = GET_OPARG(co, i, inst.op.arg);
@@ -1976,7 +1976,7 @@ _PyCode_ReturnsOnlyNone(PyCodeObject *co)
1976
1977
// Walk the bytecode, looking for RETURN_VALUE.
1978
1979
1980
1981
if (IS_RETURN_OPCODE(inst.op.code)) {
1982
assert(i != 0);
0 commit comments