Skip to content
Commit ff14585e authored by Karl-Johan Karlsson's avatar Karl-Johan Karlsson
Browse files

[builtins] Avoid undefined behavior when calculating absolute value in floatsidf.c and floatsisf.c

When compiling compiler-rt with -fsanitize=undefined and running testcases you
end up with the following warning:

UBSan: floatsidf.c:32:9: negation of -2147483648 cannot be represented in type 'si_int' (aka 'long'); cast to an unsigned type to negate this value to itself

The same kind of pattern exists in floatsisf.c

This was found in an out of tree target.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D146123
parent 34e3bc0b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment