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

[compiler-rt] Avoid signed shift overflow in __muloXi4 and __mulvXi3

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

UBSan: int_mulo_impl.inc:21:36: left shift of 1 by 63 places cannot be represented in type 'di_int' (aka 'long long')

This can be avoided by simply doing the shift in a matching unsigned variant of
the type.

The same kind of pattern seems to exist in int_mulv_impl.inc

This was found in an out of tree target.

Reviewed By: MaskRay

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