]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Manually override bytecode definition in optimizer, to avoid build error (GH-122316)
authorMark Shannon <mark@hotpy.org>
Fri, 26 Jul 2024 17:38:52 +0000 (18:38 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Jul 2024 17:38:52 +0000 (18:38 +0100)
Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h

index 4d4f89301c747570f23539056c0225d63c301a1a..c982e37182157ae8e89ab446674f0876d8cb3be4 100644 (file)
@@ -596,6 +596,14 @@ dummy_func(void) {
         }
     }
 
+    op(_MAYBE_EXPAND_METHOD, (callable, self_or_null, args[oparg] -- func, maybe_self, args[oparg])) {
+        (void)callable;
+        (void)self_or_null;
+        (void)args;
+        func = sym_new_not_null(ctx);
+        maybe_self = sym_new_not_null(ctx);
+    }
+
     op(_PY_FRAME_GENERAL, (callable, self_or_null, args[oparg] -- new_frame: _Py_UOpsAbstractFrame *)) {
         /* The _Py_UOpsAbstractFrame design assumes that we can copy arguments across directly */
         (void)callable;
index fae93ce89e82e508376fda5133bcfb0e6d454395..4fa40ff861ba70d2613463d412b6f0ad28ca51dc 100644 (file)
         }
 
         case _MAYBE_EXPAND_METHOD: {
+            _Py_UopsSymbol **args;
+            _Py_UopsSymbol *self_or_null;
+            _Py_UopsSymbol *callable;
             _Py_UopsSymbol *func;
             _Py_UopsSymbol *maybe_self;
-            _Py_UopsSymbol **args;
+            args = &stack_pointer[-oparg];
+            self_or_null = stack_pointer[-1 - oparg];
+            callable = stack_pointer[-2 - oparg];
+            (void)callable;
+            (void)self_or_null;
+            (void)args;
             func = sym_new_not_null(ctx);
             maybe_self = sym_new_not_null(ctx);
-            for (int _i = oparg; --_i >= 0;) {
-                args[_i] = sym_new_not_null(ctx);
-            }
             stack_pointer[-2 - oparg] = func;
             stack_pointer[-1 - oparg] = maybe_self;
             break;