mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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
This commit is contained in:
8
test/Assembler/extractvalue-invalid-idx.ll
Normal file
8
test/Assembler/extractvalue-invalid-idx.ll
Normal file
@@ -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
|
||||
}
|
7
test/Assembler/insertvalue-invalid-idx.ll
Normal file
7
test/Assembler/insertvalue-invalid-idx.ll
Normal file
@@ -0,0 +1,7 @@
|
||||
; RUN: not llvm-as < %s |& grep {invalid indices for insertvalue}
|
||||
|
||||
define void @test() {
|
||||
entry:
|
||||
insertvalue [0 x i32] undef, i32 0, 0
|
||||
ret void
|
||||
}
|
Reference in New Issue
Block a user