OSDN Git Service

[IR Verifier] Do not allow bitcast of pointer to vector of pointers and vice versa.
authorSerguei Katkov <serguei.katkov@azul.com>
Tue, 21 Aug 2018 04:27:07 +0000 (04:27 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Tue, 21 Aug 2018 04:27:07 +0000 (04:27 +0000)
commit69344b0171fa8b052540341715f7ceff16902768
tree8fc9ac0f44bc158f0bb2b18b0ad435073c686144
parent985a0829452b53ac48b63d61851d0d8ac1f10b56
[IR Verifier] Do not allow bitcast of pointer to vector of pointers and vice versa.

LangRef for BitCast requires that
"The bit sizes of value and the destination type, ty2, must be identical".
Currently verifier allows BitCast of pointer to vector of pointers so that
the sizes are different.

This change fixes that.

Reviewers: arsenm
Reviewed By: arsenm
Subscribers: llvm-commits, wdng
Differential Revision: https://reviews.llvm.org/D50886

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340249 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Instructions.cpp
test/Verifier/bitcast-pointer-vector-neg.ll [new file with mode: 0644]
test/Verifier/bitcast-vector-pointer-as-neg.ll [new file with mode: 0644]
test/Verifier/bitcast-vector-pointer-neg.ll [new file with mode: 0644]
test/Verifier/bitcast-vector-pointer-pos.ll [new file with mode: 0644]