Skip to content

Commit b0e5b6b

Browse files
fail automatically when seeing a method
1 parent 42340ee commit b0e5b6b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Python/specialize.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -679,19 +679,19 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
679679
PyObject *descr = NULL;
680680
DescriptorClassification kind = analyze_descriptor(type, name, &descr, 0);
681681
assert(descr != NULL || kind == ABSENT || kind == GETSET_OVERRIDDEN);
682-
if ((oparg & 1) && kind == METHOD) {
683-
if (specialize_attr_loadmethod(owner, instr, name, descr, kind)) {
684-
goto success;
682+
if (kind == METHOD) {
683+
if (oparg & 1) {
684+
if (specialize_attr_loadmethod(owner, instr, name, descr, kind)) {
685+
goto success;
686+
}
685687
}
686-
/* (fail), fall through and let LOAD_ATTR specialize for it */
688+
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD);
689+
goto fail;
687690
}
688691
switch(kind) {
689692
case OVERRIDING:
690693
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_OVERRIDING_DESCRIPTOR);
691694
goto fail;
692-
case METHOD:
693-
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD);
694-
goto fail;
695695
case PROPERTY:
696696
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_PROPERTY);
697697
goto fail;

0 commit comments

Comments
 (0)