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

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClObjDump.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/NaClObjDump.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
index c313eeb74e1e89589f23c068ce036ff58bebd3e3..119dbbf1f4b77e2d3a7b337c41e291e96eee5bee 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
@@ -591,21 +591,23 @@ public:
}
/// Generates an error with the given message.
- bool Error(const std::string &Message) override {
+ bool ErrorAt(uint64_t Bit, const std::string &Message) final {
// Use local error routine so that all errors are treated uniformly.
- ObjDump.Error() << Message << "\n";
+ ObjDump.Error(Bit) << Message << "\n";
return true;
}
/// Flushes out objdump and then exits with fatal error.
+ LLVM_ATTRIBUTE_NORETURN
void Fatal() {
- Fatal("");
+ NaClBitcodeParser::Fatal();
}
/// Flushes out objdump and then exits with fatal error, using
/// the given message.
- void Fatal(const std::string &Message) {
- ObjDump.Fatal(Message);
+ LLVM_ATTRIBUTE_NORETURN
+ void FatalAt(uint64_t Bit, const std::string &Message) final {
+ ObjDump.Fatal(Bit, Message);
}
/// Parses the top-level module block.
@@ -1371,8 +1373,8 @@ protected:
return Context->Fatal();
}
- void Fatal(const std::string &Message) {
- return Context->Fatal(Message);
+ void FatalAt(uint64_t Bit, const std::string &Message) override {
+ return Context->FatalAt(Bit, Message);
}
const std::string &GetAssemblyIndent() const {

Powered by Google App Engine
This is Rietveld 408576698