UBSan is hitting this as signed integer wrapping is undefined in C++:
int64 end = std::numeric_limits<int64>::min();
//... (snip)
if (eraseStart < end - 1)
end -= (int64) erased->range.getLength();
In my case erased->range.getLength(); was 1 so setting the initial value to std::numeric_limits<int64>::min(); + 1 fixed it but I’m not sure that’s the best appraoch.
