pr5096-fix-bitwise-instead-of-logical.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. commit 6a52786492ecae0f590136de76d078257d60c52d
  2. merge: fea299b0c0bdcef400863015439b859f2251e5dc a6f39a4bfec4c4fbdaf8708ec84ce5b98f92732c
  3. author: shadchin
  4. date: 2023-01-10T10:47:25+03:00
  5. revision: 10630852
  6. IGNIETFERRO-2000 Update Python from 3.10.9 to 3.11.1
  7. REVIEW: 2519151
  8. --- contrib/tools/cython/Cython/Compiler/ModuleNode.py (fea299b0c0bdcef400863015439b859f2251e5dc)
  9. +++ contrib/tools/cython/Cython/Compiler/ModuleNode.py (6a52786492ecae0f590136de76d078257d60c52d)
  10. @@ -1353,10 +1353,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
  11. if is_final_type:
  12. type_safety_check = ''
  13. else:
  14. - type_safety_check = ' & ((t->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0)'
  15. + type_safety_check = ' & (int)((t->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0)'
  16. obj_struct = type.declaration_code("", deref=True)
  17. code.putln(
  18. - "if (CYTHON_COMPILING_IN_CPYTHON && likely((%s > 0) & (t->tp_basicsize == sizeof(%s))%s)) {" % (
  19. + "if (CYTHON_COMPILING_IN_CPYTHON & likely((int)(%s > 0) & (int)(t->tp_basicsize == sizeof(%s))%s)) {" % (
  20. freecount_name, obj_struct, type_safety_check))
  21. code.putln("o = (PyObject*)%s[--%s];" % (
  22. freelist_name, freecount_name))
  23. @@ -1545,11 +1545,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
  24. type_safety_check = ''
  25. else:
  26. type_safety_check = (
  27. - ' & ((Py_TYPE(o)->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0)')
  28. + ' & (int)((Py_TYPE(o)->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0)')
  29. type = scope.parent_type
  30. code.putln(
  31. - "if (CYTHON_COMPILING_IN_CPYTHON && ((%s < %d) & (Py_TYPE(o)->tp_basicsize == sizeof(%s))%s)) {" % (
  32. + "if (CYTHON_COMPILING_IN_CPYTHON & ((int)(%s < %d) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(%s))%s)) {" % (
  33. freecount_name,
  34. freelist_size,
  35. type.declaration_code("", deref=True),