mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Fix off by 1 bug in printf->puts lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43309 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e9b496643
commit
0fcee0639e
@ -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…
Reference in New Issue
Block a user