aboutsummaryrefslogtreecommitdiffstats
path: root/test/Assembler/extractvalue-invalid-idx.ll
diff options
context:
space:
mode:
authorFrits van Bommel <fvbommel@gmail.com>2010-12-05 20:50:26 +0000
committerFrits van Bommel <fvbommel@gmail.com>2010-12-05 20:50:26 +0000
commita4805cf6efbcd405916cdd0eb4b6170231e906c7 (patch)
tree7f10020b63a6676f0387f7ed29f10a39c79c4b28 /test/Assembler/extractvalue-invalid-idx.ll
parent120188605fd1e3228c65daf2c5cd6c7a62d6a335 (diff)
downloadexternal_llvm-a4805cf6efbcd405916cdd0eb4b6170231e906c7.zip
external_llvm-a4805cf6efbcd405916cdd0eb4b6170231e906c7.tar.gz
external_llvm-a4805cf6efbcd405916cdd0eb4b6170231e906c7.tar.bz2
Fix PR 4170 by having ExtractValueInst::getIndexedType() reject out-of-bounds indexing.
Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler/extractvalue-invalid-idx.ll')
-rw-r--r--test/Assembler/extractvalue-invalid-idx.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Assembler/extractvalue-invalid-idx.ll b/test/Assembler/extractvalue-invalid-idx.ll
new file mode 100644
index 0000000..f9644ea
--- /dev/null
+++ b/test/Assembler/extractvalue-invalid-idx.ll
@@ -0,0 +1,8 @@
+; RUN: not llvm-as < %s |& grep {invalid indices for extractvalue}
+; PR4170
+
+define void @test() {
+entry:
+ extractvalue [0 x i32] undef, 0
+ ret void
+}