mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
"There was a typo in my previous patch which leads to miscompilation of
strncat :( strncat(foo, "bar", 99) would be optimized to memcpy(foo+strlen(foo), "bar", 100, 1) instead of memcpy(foo+strlen(foo), "bar", 4, 1)" Patch by Benjamin Kramer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68905 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1cefb74190
commit
5db4cdfc56
@ -582,7 +582,7 @@ struct VISIBILITY_HIDDEN StrNCatOpt : public StrCatOpt {
|
||||
|
||||
// strncat(x, s, c) -> strcat(x, s)
|
||||
// s is constant so the strcat can be optimized further
|
||||
EmitStrLenMemCpy(Src, Dst, Len, B);
|
||||
EmitStrLenMemCpy(Src, Dst, SrcLen, B);
|
||||
return Dst;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user