projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e9b496
)
Fix off by 1 bug in printf->puts lowering.
author
Dale Johannesen
<dalej@apple.com>
Wed, 24 Oct 2007 20:14:50 +0000
(20:14 +0000)
committer
Dale Johannesen
<dalej@apple.com>
Wed, 24 Oct 2007 20:14:50 +0000
(20:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43309
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/IPO/SimplifyLibCalls.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/IPO/SimplifyLibCalls.cpp
b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 717a5a847f878cda2b647977f6f7fa77506ca289..0904c4c6c19e779bb5bdd18403cc7f20cb22cb17 100644
(file)
--- a/
lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/
lib/Transforms/IPO/SimplifyLibCalls.cpp
@@
-1211,8
+1211,10
@@
public:
new CallInst(SLC.get_puts(), GV, "", CI);
if (CI->use_empty()) return ReplaceCallWith(CI, 0);
+ // The return value from printf includes the \n we just removed, so +1.
return ReplaceCallWith(CI,
- ConstantInt::get(CI->getType(), FormatStr.size()));
+ ConstantInt::get(CI->getType(),
+ FormatStr.size()+1));
}