Since TypeInfos are passed as i8 pointers, a NULL TypeInfo should be passed

as a null i8 pointer not as a 0 i32.

llvm-svn: 37383
This commit is contained in:
Duncan Sands 2007-06-01 08:18:30 +00:00
parent 6a2cf070cc
commit 706421e712
1 changed files with 2 additions and 4 deletions

View File

@ -2620,8 +2620,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
Constant *C = cast<Constant>(I.getOperand(i));
GlobalVariable *GV = ExtractGlobalVariable(C);
assert (GV || (isa<ConstantInt>(C) &&
cast<ConstantInt>(C)->isNullValue()) &&
assert (GV || isa<ConstantPointerNull>(C) &&
"TypeInfo must be a global variable or NULL");
TyInfo.push_back(GV);
}
@ -2653,8 +2652,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
// Find the type id for the given typeinfo.
Constant *C = cast<Constant>(I.getOperand(1));
GlobalVariable *GV = ExtractGlobalVariable(C);
assert (GV || (isa<ConstantInt>(C) &&
cast<ConstantInt>(C)->isNullValue()) &&
assert (GV || isa<ConstantPointerNull>(C) &&
"TypeInfo must be a global variable or NULL");
unsigned TypeID = MMI->getTypeIDFor(GV);