[Mingw-w64-public] [PATCH] math: Avoid signed integer overflow in inlinable isnan

2022-11-08 Thread Oleg Oshmyan via Mingw-w64-public
When int x == INT_MIN, the behaviour of `-x` is undefined. This causes a crash when isnan is inlined into code instrumented for Clang's or GCC's -ftrapv, -fsanitize=signed-integer-overflow, -fsanitize=undefined or similar. Instead of mucking about with `int` and `unsigned`, just use `unsigned` thr

Re: [Mingw-w64-public] [PATCH] math: Avoid signed integer overflow in inlinable isnan

2022-11-09 Thread Martin Storsjö
On Wed, 9 Nov 2022, Oleg Oshmyan via Mingw-w64-public wrote: When int x == INT_MIN, the behaviour of `-x` is undefined. This causes a crash when isnan is inlined into code instrumented for Clang's or GCC's -ftrapv, -fsanitize=signed-integer-overflow, -fsanitize=undefined or similar. Instead of

Re: [Mingw-w64-public] [PATCH] math: Avoid signed integer overflow in inlinable isnan

2022-11-10 Thread Martin Storsjö
On Wed, 9 Nov 2022, Martin Storsjö wrote: On Wed, 9 Nov 2022, Oleg Oshmyan via Mingw-w64-public wrote: When int x == INT_MIN, the behaviour of `-x` is undefined. This causes a crash when isnan is inlined into code instrumented for Clang's or GCC's -ftrapv, -fsanitize=signed-integer-overflow, -