Disable unsigned integer sanitizer for basic_string::replace(). Patch from tomcherry@google.com

basic_string::replace() has the below line

__sz += __n2 - __n1;

which fails overflow checks if __n1 > __n2, as the negative result
from the subtraction then overflows the original __sz when added to
it.

This behavior is valid as unsigned integer overflow is defined to wrap
around the maximum value and that produces the correct final value for
__sz.  Therefore, we disable this check on this function.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297355 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed