mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 01:03:52 +00:00
Fix off by 1 bug in printf->puts lowering.
llvm-svn: 43309
This commit is contained in:
parent
b3085f2d74
commit
414ad5d4a4
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user