summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2015-05-30 00:17:20 +0000
committerFilipe Cabecinhas <me@filcab.net>2015-05-30 00:17:20 +0000
commit14e686774d8807265d921ff0c2d1e8ac8e1ab072 (patch)
tree588968e09e07d5037e0c3244cd81903616c8d896 /llvm/test
parentb82e33106bdfcace762c441f628f1125ae6a0957 (diff)
downloadbcm5719-llvm-14e686774d8807265d921ff0c2d1e8ac8e1ab072.tar.gz
bcm5719-llvm-14e686774d8807265d921ff0c2d1e8ac8e1ab072.zip
[BitcodeReader] Change an assert to a call to a call to Error()
It's reachable from user input. Bug found with AFL fuzz. llvm-svn: 238633
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bcbin0 -> 878 bytes
-rw-r--r--llvm/test/Bitcode/invalid.test5
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc b/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc
new file mode 100644
index 00000000000..42a2c3e65fe
--- /dev/null
+++ b/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc
Binary files differ
diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test
index eb7f979d574..43f7c77d598 100644
--- a/llvm/test/Bitcode/invalid.test
+++ b/llvm/test/Bitcode/invalid.test
@@ -187,3 +187,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-operand-encoding.bc 2>
RUN: FileCheck --check-prefix=ARRAY-OP-ENC %s
ARRAY-OP-ENC: Array element type has to be an encoding of a type
+
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-metadata-not-followed-named-node.bc 2>&1 | \
+RUN: FileCheck --check-prefix=META-NOT-FOLLOWED-BY-NAMED-META %s
+
+META-NOT-FOLLOWED-BY-NAMED-META: METADATA_NAME not followed by METADATA_NAMED_NODE
OpenPOWER on IntegriCloud