mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-11 05:17:36 +00:00
Revert r295138: Instead of a series of string operations, use snprintf().
This broke buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7855b94bca
commit
da87ca0f4c
@ -434,8 +434,10 @@ void WinCOFFObjectWriter::SetSectionName(COFFSection &S) {
|
||||
|
||||
uint64_t StringTableEntry = Strings.getOffset(S.Name);
|
||||
if (StringTableEntry <= Max7DecimalOffset) {
|
||||
snprintf(S.Header.Name, sizeof(S.Header.Name), "/%" PRIu64,
|
||||
StringTableEntry);
|
||||
SmallVector<char, COFF::NameSize> Buffer;
|
||||
Twine('/').concat(Twine(StringTableEntry)).toVector(Buffer);
|
||||
assert(Buffer.size() <= COFF::NameSize && Buffer.size() >= 2);
|
||||
std::memcpy(S.Header.Name, Buffer.data(), Buffer.size());
|
||||
return;
|
||||
}
|
||||
if (StringTableEntry <= MaxBase64Offset) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user