Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp

Issue 932953002: Fix the NaCl bitstream reader to report fatal errors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix formatting. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp b/lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp
index 95ae269c46fb06f56e481dc6ef18282c76b05e58..f9d22829170e7f5bdf4b0767648030a071362941 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp
@@ -171,16 +171,7 @@ RecordTextFormatter::RecordTextFormatter(ObjDumpStream *ObjDump)
std::string RecordTextFormatter::RecordAddress(uint64_t Bit,
unsigned MinByteWidth) {
- std::string Buffer;
- raw_string_ostream Stream(Buffer);
- Stream << '%' << MinByteWidth << PRIu64 << ":%u";
- Stream.flush();
- std::string FormatString(Buffer);
- Buffer.clear();
- Stream << format(FormatString.c_str(),
- (Bit / 8),
- static_cast<unsigned>(Bit % 8));
- return Stream.str();
+ return NaClBitstreamReader::getBitAddress(Bit, MinByteWidth);
jvoung (off chromium) 2015/02/20 00:12:42 Can this variant of RecordAddress be removed and N
Karl 2015/02/20 21:41:17 Removed all instances of RecordAddress and ObjDump
}
std::string RecordTextFormatter::GetEmptyLabelColumn() {
@@ -276,6 +267,7 @@ void ObjDumpStream::Fatal(uint64_t Bit,
LastKnownBit = Bit;
PrintMessagePrefix("Error", Bit) << Message;
Write(Bit, Record);
+ Flush();
llvm::report_fatal_error("Unable to continue");
}

Powered by Google App Engine
This is Rietveld 408576698