mirror of
https://github.com/RPCSX/llvm.git
synced 2026-01-31 01:05:23 +01:00
Resubmit "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
This was originally reverted because of some non-deterministic failures on certain buildbots. Luckily ASAN eventually caught this as a stack-use-after-scope, so the fix is included in this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -58,6 +58,10 @@ Error DebugStringTableSubsection::commit(BinaryStreamWriter &Writer) const {
|
||||
uint32_t Begin = Writer.getOffset();
|
||||
uint32_t End = Begin + StringSize;
|
||||
|
||||
// Write a null string at the beginning.
|
||||
if (auto EC = Writer.writeCString(StringRef()))
|
||||
return EC;
|
||||
|
||||
for (auto &Pair : Strings) {
|
||||
StringRef S = Pair.getKey();
|
||||
uint32_t Offset = Begin + Pair.getValue();
|
||||
@@ -68,6 +72,7 @@ Error DebugStringTableSubsection::commit(BinaryStreamWriter &Writer) const {
|
||||
}
|
||||
|
||||
Writer.setOffset(End);
|
||||
assert((End - Begin) == StringSize);
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user