OSDN Git Service

[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)
commit783db05d7bb5fa7d3ab5f4bd0b5ad4378ea49e48
tree5e0ac582babef754695aa4120698f125b462b81a
parenta80d09e0417ba9aaa776ecc304b4e749ec83f95d
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267580 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/sprintf-1.ll