Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8877e4

Browse files
Respect op caches.
1 parent88f7beb commitc8877e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Objects/codeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ identify_unbound_names(PyThreadState *tstate, PyCodeObject *co,
17301730
assert(counts==NULL||counts->total==0);
17311731
structco_unbound_countsunbound= {0};
17321732
Py_ssize_tlen=Py_SIZE(co);
1733-
for (inti=0;i<len;i++) {
1733+
for (inti=0;i<len;i+=_PyInstruction_GetLength(co,i)) {
17341734
_Py_CODEUNITinst=_Py_GetBaseCodeUnit(co,i);
17351735
if (inst.op.code==LOAD_ATTR) {
17361736
intoparg=GET_OPARG(co,i,inst.op.arg);
@@ -1976,7 +1976,7 @@ _PyCode_ReturnsOnlyNone(PyCodeObject *co)
19761976

19771977
// Walk the bytecode, looking for RETURN_VALUE.
19781978
Py_ssize_tlen=Py_SIZE(co);
1979-
for (inti=0;i<len;i++) {
1979+
for (inti=0;i<len;i+=_PyInstruction_GetLength(co,i)) {
19801980
_Py_CODEUNITinst=_Py_GetBaseCodeUnit(co,i);
19811981
if (IS_RETURN_OPCODE(inst.op.code)) {
19821982
assert(i!=0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp