Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input
authorFilipe Cabecinhas <me@filcab.net>
Fri, 16 Jan 2015 04:54:12 +0000 (04:54 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Fri, 16 Jan 2015 04:54:12 +0000 (04:54 +0000)
llvm-svn: 226248

llvm/include/llvm/Bitcode/BitCodes.h
llvm/test/Bitcode/Inputs/invalid-pr20485.bc [new file with mode: 0644]
llvm/test/Bitcode/invalid.test [new file with mode: 0644]

index ed2dcf8..3f7a77d 100644 (file)
@@ -125,7 +125,7 @@ public:
     case Blob:
       return false;
     }
-    llvm_unreachable("Invalid encoding");
+    report_fatal_error("Invalid encoding");
   }
 
   /// isChar6 - Return true if this character is legal in the Char6 encoding.
diff --git a/llvm/test/Bitcode/Inputs/invalid-pr20485.bc b/llvm/test/Bitcode/Inputs/invalid-pr20485.bc
new file mode 100644 (file)
index 0000000..b6211de
Binary files /dev/null and b/llvm/test/Bitcode/Inputs/invalid-pr20485.bc differ
diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test
new file mode 100644 (file)
index 0000000..5f88da4
--- /dev/null
@@ -0,0 +1 @@
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc