void-packages/srcpkgs/blender/patches/python3.12-opcode.patch

90 lines
3.0 KiB
Diff

https://src.fedoraproject.org/rpms/blender/raw/7045717eb5477c40905f6d29dfd3dbf5ed674e4d/f/blender-3.6.1-py312-opcode.patch
--- blender-3.6.1/source/blender/python/intern/bpy_driver.c.pyop 2023-05-18 08:04:45.000000000 +0900
+++ blender-3.6.1/source/blender/python/intern/bpy_driver.c 2023-08-01 17:11:06.356802916 +0900
@@ -313,14 +313,27 @@ static const bool secure_opcodes[255] =
OK_OP(CACHE),
OK_OP(POP_TOP),
OK_OP(PUSH_NULL),
+#if PY_VERSION_HEX >= 0x030c0000 /* Python 3.12 and newer */
+ OK_OP(INTERPRETER_EXIT),
+ OK_OP(END_FOR),
+ OK_OP(END_SEND),
+#endif
OK_OP(NOP),
+#if PY_VERSION_HEX < 0x030c0000 /* older than Python 3.12 */
OK_OP(UNARY_POSITIVE),
+#endif
OK_OP(UNARY_NEGATIVE),
OK_OP(UNARY_NOT),
OK_OP(UNARY_INVERT),
OK_OP(BINARY_SUBSCR),
+#if PY_VERSION_HEX >= 0x030c0000 /* Python 3.12 and newer */
+ OK_OP(BINARY_SLICE),
+ OK_OP(STORE_SLICE),
+#endif
OK_OP(GET_LEN),
+#if PY_VERSION_HEX < 0x030c0000 /* older than Python 3.12 */
OK_OP(LIST_TO_TUPLE),
+#endif
OK_OP(RETURN_VALUE),
OK_OP(SWAP),
OK_OP(BUILD_TUPLE),
@@ -329,10 +342,15 @@ static const bool secure_opcodes[255] =
OK_OP(BUILD_MAP),
OK_OP(COMPARE_OP),
OK_OP(JUMP_FORWARD),
+#if PY_VERSION_HEX >= 0x030c0000 /* Python 3.12 and newer */
+ OK_OP(POP_JUMP_IF_FALSE),
+ OK_OP(POP_JUMP_IF_TRUE),
+#else
OK_OP(JUMP_IF_FALSE_OR_POP),
OK_OP(JUMP_IF_TRUE_OR_POP),
OK_OP(POP_JUMP_FORWARD_IF_FALSE),
OK_OP(POP_JUMP_FORWARD_IF_TRUE),
+#endif
OK_OP(LOAD_GLOBAL),
OK_OP(IS_OP),
OK_OP(CONTAINS_OP),
@@ -340,8 +358,13 @@ static const bool secure_opcodes[255] =
OK_OP(LOAD_FAST),
OK_OP(STORE_FAST),
OK_OP(DELETE_FAST),
+#if PY_VERSION_HEX >= 0x030c0000 /* Python 3.12 and newer */
+ OK_OP(POP_JUMP_IF_NOT_NONE),
+ OK_OP(POP_JUMP_IF_NONE),
+#else
OK_OP(POP_JUMP_FORWARD_IF_NOT_NONE),
OK_OP(POP_JUMP_FORWARD_IF_NONE),
+#endif
OK_OP(BUILD_SLICE),
OK_OP(LOAD_DEREF),
OK_OP(STORE_DEREF),
@@ -354,17 +377,26 @@ static const bool secure_opcodes[255] =
OK_OP(DICT_MERGE),
OK_OP(DICT_UPDATE),
# endif
+#if PY_VERSION_HEX >= 0x030c0000 /* Python 3.12 and newer */
+ OK_OP(INSTRUMENTED_POP_JUMP_IF_NONE),
+ OK_OP(INSTRUMENTED_POP_JUMP_IF_NOT_NONE),
+ OK_OP(INSTRUMENTED_POP_JUMP_IF_FALSE),
+ OK_OP(INSTRUMENTED_POP_JUMP_IF_TRUE),
+#else
OK_OP(POP_JUMP_BACKWARD_IF_NOT_NONE),
OK_OP(POP_JUMP_BACKWARD_IF_NONE),
OK_OP(POP_JUMP_BACKWARD_IF_FALSE),
OK_OP(POP_JUMP_BACKWARD_IF_TRUE),
+#endif
/* Special cases. */
OK_OP(LOAD_CONST), /* Ok because constants are accepted. */
OK_OP(LOAD_NAME), /* Ok, because `PyCodeObject.names` is checked. */
OK_OP(CALL), /* Ok, because we check its "name" before calling. */
OK_OP(KW_NAMES), /* Ok, because it's used for calling functions with keyword arguments. */
+#if PY_VERSION_HEX < 0x030c0000 /* older than Python 3.12 */
OK_OP(PRECALL), /* Ok, because it's used for calling. */
+#endif
# else /* Python 3.10 and older. */