aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index aecf955863..ef323c14ba 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -468,11 +468,13 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
// The source value may be an integer, or a pointer.
if (isa<llvm::PointerType>(Src->getType())) {
// Some heavy lifting for derived to base conversion.
+ // FIXME: This should be handled by EmitCast.
if (const CXXRecordDecl *ClassDecl =
SrcType->getCXXRecordDeclForPointerType())
if (const CXXRecordDecl *BaseClassDecl =
DstType->getCXXRecordDeclForPointerType())
- Src = CGF.AddressCXXOfBaseClass(Src, ClassDecl, BaseClassDecl);
+ Src = CGF.GetAddressCXXOfBaseClass(Src, ClassDecl, BaseClassDecl,
+ /*NullCheckValue=*/false);
return Builder.CreateBitCast(Src, DstTy, "conv");
}
assert(SrcType->isIntegerType() && "Not ptr->ptr or int->ptr conversion?");