[llvm-commits] [PATCH] Fix strncat optimization

Chris Lattner clattner at apple.com
Sun Apr 12 11:22:55 PDT 2009


On Apr 12, 2009, at 4:04 AM, Benjamin Kramer wrote:

> There was a typo in my previous patch which leads to miscompilation of
> strncat :(
>
> strncat(foo, "bar", 99)
> would be optimized to
> memcpy(foo+strlen(foo), "bar", 100, 1)
> instead of
> memcpy(foo+strlen(foo), "bar", 4, 1)

Nice catch, I'm sorry I missed this in the review.  Applied here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090406/076229.html



More information about the llvm-commits mailing list