[llvm-dev] Clang 5, UBsan, runtime error: addition of unsigned offset to X overflowed to Y

John Regehr via llvm-dev llvm-dev at lists.llvm.org
Sun Dec 17 18:53:23 PST 2017


> The overflow is troubling because signed integer overflow is undefined
> behavior. The code above depends on unsigned wrap, and that's well
> defined behavior. We don't know where the signed operations are coming
> from.

Unsigned integer overflow is defined, but pointers are not integers and 
pointer overflow is undefined.

John



More information about the llvm-dev mailing list