Skip to content
Merged
Prev Previous commit
Next Next commit
Fix size of short
  • Loading branch information
emmatyping committed Aug 19, 2022
commit 6f342906713a035d381332b6069997f8ea955f3f
4 changes: 3 additions & 1 deletion mypyc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
IS_MIXED_32_64_BIT_BUILD: Final = sys.platform in ["darwin"] and sys.version_info < (3, 6)

# Maximum value for a short tagged integer.
MAX_SHORT_INT: Final = sys.maxsize >> 1 if SIZEOF_SIZE_T is None else 2 ** int(SIZEOF_SIZE_T)
MAX_SHORT_INT: Final = (
sys.maxsize >> 1 if SIZEOF_SIZE_T is None else 2 ** (8 * int(SIZEOF_SIZE_T) - 2) - 1
)

# Maximum value for a short tagged integer represented as a C integer literal.
#
Expand Down