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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226248 91177308-0d34-0410-b5e6-96231b3b80d8

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

index ed2dcf84f924df78aba6a79740ba9a3bf6037d9b..3f7a77d592c8a550a0334946f82cad510a836ca7 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/test/Bitcode/Inputs/invalid-pr20485.bc b/test/Bitcode/Inputs/invalid-pr20485.bc
new file mode 100644 (file)
index 0000000..b6211de
Binary files /dev/null and b/test/Bitcode/Inputs/invalid-pr20485.bc differ
diff --git a/test/Bitcode/invalid.test b/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