Skip to content

Commit b2a723a

Browse files
committed
Make default IV_MUL_OVERFLOW_IS_EXPENSIVE reasonable on LLP64 platforms
This will affect Win32 x86-64. Thanks to @tonycoz for figuring this out. (intended to be squashed before merge)
1 parent f318498 commit b2a723a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inline.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3425,8 +3425,10 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp)
34253425
# endif
34263426
# ifndef IV_MUL_OVERFLOW_IS_EXPENSIVE
34273427
/* Strict overflow check for IV multiplication is generally expensive
3428-
* when IV is a multi-word integer. */
3429-
# define IV_MUL_OVERFLOW_IS_EXPENSIVE (IVSIZE > LONGSIZE)
3428+
* when IV is a multi-word integer.
3429+
* We assume that PTRSIZE matches the platform word size; LONGSIZE might not
3430+
* match for LLP64 platforms such as Win32 x86-64. */
3431+
# define IV_MUL_OVERFLOW_IS_EXPENSIVE (IVSIZE > PTRSIZE)
34303432
# endif
34313433

34323434
# if defined(I_STDCKDINT) && !IV_ADD_SUB_OVERFLOW_IS_EXPENSIVE

0 commit comments

Comments
 (0)