mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed bitcast null issue
This commit is contained in:
parent
d3e33365f0
commit
7115cb8e82
2 changed files with 3 additions and 0 deletions
|
@ -866,6 +866,7 @@ BfIRValue BfIRConstHolder::CreateConstBitCast(BfIRValue val, BfIRType type)
|
||||||
bitCast->mConstType = BfConstType_BitCastNull;
|
bitCast->mConstType = BfConstType_BitCastNull;
|
||||||
else
|
else
|
||||||
bitCast->mConstType = BfConstType_BitCast;
|
bitCast->mConstType = BfConstType_BitCast;
|
||||||
|
BF_ASSERT(val.mId != -1);
|
||||||
bitCast->mTarget = val.mId;
|
bitCast->mTarget = val.mId;
|
||||||
bitCast->mToType = type;
|
bitCast->mToType = type;
|
||||||
|
|
||||||
|
|
|
@ -10880,6 +10880,8 @@ void BfModule::CurrentAddToConstHolder(BfIRValue& irVal)
|
||||||
newVal = BfIRValue(BfIRValueFlags_Const, bitcast->mTarget);
|
newVal = BfIRValue(BfIRValueFlags_Const, bitcast->mTarget);
|
||||||
CurrentAddToConstHolder(newVal);
|
CurrentAddToConstHolder(newVal);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
newVal = mCurTypeInstance->GetOrCreateConstHolder()->CreateConstNull();
|
||||||
irVal = mCurTypeInstance->GetOrCreateConstHolder()->CreateConstBitCast(newVal, bitcast->mToType);
|
irVal = mCurTypeInstance->GetOrCreateConstHolder()->CreateConstBitCast(newVal, bitcast->mToType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue