Skip to content

Commit 66f53e3

Browse files
committed
tmp fix
1 parent 24e31d5 commit 66f53e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,10 @@ llvm::Value *ItaniumCXXABI::EmitMemberDataPointerAddress(
873873
CGBuilderTy &Builder = CGF.Builder;
874874

875875
// Apply the offset, which we assume is non-null.
876-
return Builder.CreateInBoundsGEP(CGF.Int8Ty, Base.emitRawPointer(CGF), MemPtr,
876+
llvm::Value *BasePtr = Base.emitRawPointer(CGF);
877+
if (isa<llvm::ConstantPointerNull>(BasePtr))
878+
return Builder.CreateGEP(CGF.Int8Ty, BasePtr, MemPtr, "memptr.offset");
879+
return Builder.CreateInBoundsGEP(CGF.Int8Ty, BasePtr, MemPtr,
877880
"memptr.offset");
878881
}
879882

0 commit comments

Comments
 (0)