diff options
author | Sean Silva <silvas@purdue.edu> | 2013-07-09 00:54:46 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2013-07-09 00:54:46 +0000 |
commit | 845e196a52d52abcd789612750f6f34af3a2cc79 (patch) | |
tree | 86327dd6724ec9b068a26ecaeabd48913d8c5f30 /lib/Object | |
parent | b49401533082fa0e8625c7cbaa0813db6c4c9bd5 (diff) | |
download | external_llvm-845e196a52d52abcd789612750f6f34af3a2cc79.zip external_llvm-845e196a52d52abcd789612750f6f34af3a2cc79.tar.gz external_llvm-845e196a52d52abcd789612750f6f34af3a2cc79.tar.bz2 |
Make BinaryRef output correctly in case of empty data.
Previously, it would simply output nothing, but it should output an
empty string `""`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/YAML.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Object/YAML.cpp b/lib/Object/YAML.cpp index 4e7f089..5b66503 100644 --- a/lib/Object/YAML.cpp +++ b/lib/Object/YAML.cpp @@ -49,6 +49,10 @@ void BinaryRef::writeAsBinary(raw_ostream &OS) const { } void BinaryRef::writeAsHex(raw_ostream &OS) const { + if (binary_size() == 0) { + OS << "\"\""; + return; + } if (DataIsHexString) { OS.write((const char *)Data.data(), Data.size()); return; |