From a9caf9cf9041d6d0b69f8be0fd778dd1f9b50e74 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Wed, 9 Aug 2023 11:19:39 -0700 Subject: GH-105848: Simplify the arrangement of CALL's stack (GH-107788) --- Python/specialize.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Python/specialize.c') diff --git a/Python/specialize.c b/Python/specialize.c index 855252e066d..98455ae3efc 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -793,6 +793,10 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) if (!function_check_args(fget, 1, LOAD_ATTR)) { goto fail; } + if (instr->op.arg & 1) { + SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD); + goto fail; + } uint32_t version = function_get_version(fget, LOAD_ATTR); if (version == 0) { goto fail; @@ -859,6 +863,10 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name) if (!function_check_args(descr, 2, LOAD_ATTR)) { goto fail; } + if (instr->op.arg & 1) { + SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_METHOD); + goto fail; + } uint32_t version = function_get_version(descr, LOAD_ATTR); if (version == 0) { goto fail; -- cgit v1.2.3