[llvm-commits] Fix for overflow in SmallVector

Chris Lattner clattner at apple.com
Wed Apr 1 20:06:46 PDT 2009


On Apr 1, 2009, at 7:01 PM, Jeffrey Yasskin wrote:

> The code was doing "if (End+NumInputs > Capacity) ...". If End is
> close to 0xFFFFFFFF and NumInputs is large, it'll overflow, the
> condition will come out false, and the vector won't grow to
> accommodate the new elements, and the program will crash in memmove.

Whoa, nice catch!  Fixed here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090330/075970.html

-Chris



More information about the llvm-commits mailing list