[llvm-commits] [PATCH] Fix strncat optimization

Benjamin Kramer benny.kra at googlemail.com
Sun Apr 12 04:04:23 PDT 2009


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)

The attached patch corrects this.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: strncatfix.patch
Type: application/octet-stream
Size: 479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090412/e10ee07b/attachment.obj>
-------------- next part --------------



More information about the llvm-commits mailing list