From 47d5b20f3269dcedaccd6f546b059727e35dd01b Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Fri, 16 Jan 2015 04:54:12 +0000 Subject: [PATCH] Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input llvm-svn: 226248 --- include/llvm/Bitcode/BitCodes.h | 2 +- test/Bitcode/Inputs/invalid-pr20485.bc | Bin 0 -> 272 bytes test/Bitcode/invalid.test | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test/Bitcode/Inputs/invalid-pr20485.bc create mode 100644 test/Bitcode/invalid.test diff --git a/include/llvm/Bitcode/BitCodes.h b/include/llvm/Bitcode/BitCodes.h index ed2dcf84f92..3f7a77d592c 100644 --- a/include/llvm/Bitcode/BitCodes.h +++ b/include/llvm/Bitcode/BitCodes.h @@ -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 index 0000000000000000000000000000000000000000..b6211de88ff95aacb94dbd475c14639e348f35e7 GIT binary patch literal 272 zcmZ>AK5$Qwhk?P7fq{X$Nr8b0NDBcmd!zD1#}h1`Yyw7>lNeigR9QJB!e zoF;KQu?QH6Sa3*qGBCKPcyLWnR6Y{az$2+xq{4oJLm+9zf)x(OJ}?5!=~Q4~-~iG_ zN*o*tDXlER3QJmm#N(EQ6GVi38hW@}SbPM4@|6+{4DvwQn4>}F$U~Vl5k}h%XN#7@ zJx&eml@;v8GYWa0G4Q_?;QP|RXUyXycj%z(xrH)m2CQIZ&C+L>ZBIDc_AuL?spu&w zV6Wz2uk>gyC}6KDU@og@FHmTgJR`{WW&+LBqJ_PU?3mlQXrzmqnQT9-x J9MEnM000-oN<;tv literal 0 HcmV?d00001 diff --git a/test/Bitcode/invalid.test b/test/Bitcode/invalid.test new file mode 100644 index 00000000000..5f88da45f6a --- /dev/null +++ b/test/Bitcode/invalid.test @@ -0,0 +1 @@ +RUN: not llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc