[SimplifyLibCalls] sprintf doesn't copy null bytes
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 26 Apr 2016 18:16:49 +0000 (18:16 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 26 Apr 2016 18:16:49 +0000 (18:16 +0000)
commit8cd77baebc7620b18b4b830d52416762860c291b
tree6ff39c3a0577f18f5783d0817c69a994328d8077
parent1c3f65a18cad4d46e8683e47430694c8d8f2ccbe
[SimplifyLibCalls] sprintf doesn't copy null bytes

sprintf doesn't read or copy the terminating null byte from it's string
operands.  sprintf will append it's own after processing all of the
format specifiers.

This fixes PR27526.

llvm-svn: 267580
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/sprintf-1.ll