From c53296eb6d97f37fc1326f3ab38c3c811390b838 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 7 Jun 2008 17:27:51 +0000 Subject: =?UTF-8?q?Fix=20crash=20with=20conversion=20to=20an=20address-spa?= =?UTF-8?q?ce-qualified=20pointer.=20=20Bug=20reported=20on=20cfe-dev=20by?= =?UTF-8?q?=20C=C3=A9dric=20Venet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/CodeGen/CGExprConstant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExprConstant.cpp') 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(DstType)) { + if (isa(DstTy)) { // The source value may be an integer, or a pointer. if (isa(Src->getType())) return llvm::ConstantExpr::getBitCast(Src, DstTy); @@ -640,7 +640,7 @@ public: return llvm::ConstantExpr::getIntToPtr(Src, DstTy); } - if (isa(SrcType)) { + if (isa(Src->getType())) { // Must be an ptr to int cast. assert(isa(DstTy) && "not ptr->int?"); return llvm::ConstantExpr::getPtrToInt(Src, DstTy); -- cgit v1.2.3