diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-06-07 17:27:51 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-06-07 17:27:51 +0000 |
commit | c53296eb6d97f37fc1326f3ab38c3c811390b838 (patch) | |
tree | 93a809c87ee5dcc16bb1c27b43ed7f542c38ff76 /lib/CodeGen/CGExprConstant.cpp | |
parent | 56d29376459f88dcdbcbf6c9a83c2f77e433f1e2 (diff) |
Fix crash with conversion to an address-space-qualified pointer. Bug
reported on cfe-dev by Cédric Venet.
Note that I seriously doubt that this perticular construct is useful,
though: it's a pointer in an alternate address space pointing into
unqualified address space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index f5977728af..cae1f4bb24 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -632,7 +632,7 @@ public: // Handle pointer conversions next: pointers can only be converted to/from // other pointers and integers. - if (isa<PointerType>(DstType)) { + if (isa<llvm::PointerType>(DstTy)) { // The source value may be an integer, or a pointer. if (isa<llvm::PointerType>(Src->getType())) return llvm::ConstantExpr::getBitCast(Src, DstTy); @@ -640,7 +640,7 @@ public: return llvm::ConstantExpr::getIntToPtr(Src, DstTy); } - if (isa<PointerType>(SrcType)) { + if (isa<llvm::PointerType>(Src->getType())) { // Must be an ptr to int cast. assert(isa<llvm::IntegerType>(DstTy) && "not ptr->int?"); return llvm::ConstantExpr::getPtrToInt(Src, DstTy); |