Fix crash when looking up the addrspace of GEPs with vector types

Patch by Björn Steinbrink

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216930 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault 2014-09-02 18:47:54 +00:00
parent f93099eb1c
commit 0565503d5d
2 changed files with 13 additions and 1 deletions

View File

@ -402,7 +402,7 @@ public:
/// getPointerAddressSpace - Method to return the address space of the
/// pointer operand.
unsigned getPointerAddressSpace() const {
return cast<PointerType>(getPointerOperandType())->getAddressSpace();
return getPointerOperandType()->getPointerAddressSpace();
}
unsigned getNumIndices() const { // Note: always non-negative

View File

@ -0,0 +1,12 @@
; RUN: opt -mergefunc -disable-output < %s
; This used to cause a crash when compairing the GEPs
define void @foo(<2 x i64*>) {
%tmp = getelementptr <2 x i64*> %0, <2 x i64> <i64 0, i64 0>
ret void
}
define void @bar(<2 x i64*>) {
%tmp = getelementptr <2 x i64*> %0, <2 x i64> <i64 0, i64 0>
ret void
}