From c175b46ea1914001c284e667007cd1c2b72f10fc Mon Sep 17 00:00:00 2001 From: Dino Viehland Date: Fri, 2 Aug 2024 16:37:14 -0700 Subject: [PATCH] Fix Cinder's awaiter flag to not conflict with version tag Summary: `Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18)` is defined on line 575 as `(1UL << 18)` so we can't use 18 here. Change to 21 which is unused. This is causing a crash when subclassing a Cython class D60555759 and trying to copy the non-existent async methods here: https://www.internalfb.com/code/fbsource/[03a8cbcbe4d4f8d35cf0837de169925d564d479f]/third-party/python/3.12/Objects/typeobject.c?lines=3352 Reviewed By: yulong-zhang-1 Differential Revision: D60627205 fbshipit-source-id: d3d5998b39df88d9aa03c04539f7adfdf52f0121 --- Include/object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/object.h b/Include/object.h index 8494114514f..d9770ef716f 100644 --- a/Include/object.h +++ b/Include/object.h @@ -527,15 +527,15 @@ given type object has a specified feature. /* Objects behave like an unbound method */ #define Py_TPFLAGS_METHOD_DESCRIPTOR (1UL << 17) -/* Set if type's tp_as_async slot points to Ci_AsyncMethodsWithExtra */ -#define Ci_TPFLAGS_HAVE_AM_EXTRA (1UL << 18) - /* Object has up-to-date type attribute cache */ #define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19) /* Type is abstract and cannot be instantiated */ #define Py_TPFLAGS_IS_ABSTRACT (1UL << 20) +/* Set if type's tp_as_async slot points to Ci_AsyncMethodsWithExtra */ +#define Ci_TPFLAGS_HAVE_AM_EXTRA (1UL << 21) + // This undocumented flag gives certain built-ins their unique pattern-matching // behavior, which allows a single positional subpattern to match against the // subject itself (rather than a mapped attribute on it):