[llvm] r226248 - Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input

Filipe Cabecinhas me at filcab.net
Thu Jan 15 20:54:12 PST 2015


Author: filcab
Date: Thu Jan 15 22:54:12 2015
New Revision: 226248

URL: http://llvm.org/viewvc/llvm-project?rev=226248&view=rev
Log:
Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input

Added:
    llvm/trunk/test/Bitcode/Inputs/
    llvm/trunk/test/Bitcode/Inputs/invalid-pr20485.bc
    llvm/trunk/test/Bitcode/invalid.test
Modified:
    llvm/trunk/include/llvm/Bitcode/BitCodes.h

Modified: llvm/trunk/include/llvm/Bitcode/BitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitCodes.h?rev=226248&r1=226247&r2=226248&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitCodes.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitCodes.h Thu Jan 15 22:54:12 2015
@@ -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.

Added: llvm/trunk/test/Bitcode/Inputs/invalid-pr20485.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/Inputs/invalid-pr20485.bc?rev=226248&view=auto
==============================================================================
Binary files llvm/trunk/test/Bitcode/Inputs/invalid-pr20485.bc (added) and llvm/trunk/test/Bitcode/Inputs/invalid-pr20485.bc Thu Jan 15 22:54:12 2015 differ

Added: llvm/trunk/test/Bitcode/invalid.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/invalid.test?rev=226248&view=auto
==============================================================================
--- llvm/trunk/test/Bitcode/invalid.test (added)
+++ llvm/trunk/test/Bitcode/invalid.test Thu Jan 15 22:54:12 2015
@@ -0,0 +1 @@
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc





More information about the llvm-commits mailing list