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

Unified Diff: lib/Bitcode/NaCl/Reader/NaClBitCodes.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: Merge with master 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
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitcodeParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Reader/NaClBitCodes.cpp
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitCodes.cpp b/lib/Bitcode/NaCl/Reader/NaClBitCodes.cpp
index 76811a1f091eb8c6ba2153435cc327fd42ec7817..5bfbd8f440d6767fe142abecac2300b92fcb5772 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitCodes.cpp
+++ b/lib/Bitcode/NaCl/Reader/NaClBitCodes.cpp
@@ -120,6 +120,7 @@ bool NaClBitCodeAbbrev::isValid() const {
// Verify that an array op appears can only appear if it is the
// second to last element.
unsigned NumOperands = getNumOperandInfos();
+ if (NumOperands == 0) return false;
for (unsigned i = 0; i < NumOperands; ++i) {
const NaClBitCodeAbbrevOp &Op = getOperandInfo(i);
if (Op.isArrayOp() && i + 2 != NumOperands)
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitcodeParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698