mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed struct construction when type is unpopulated. Better error check.
This commit is contained in:
parent
2b6e1d0d5d
commit
33448603b1
3 changed files with 3 additions and 1 deletions
|
@ -6867,6 +6867,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
|
||||||
mModule->mCompiler->mResolvePassData->HandleTypeReference(targetSrc, resolvedTypeInstance->mTypeDef);
|
mModule->mCompiler->mResolvePassData->HandleTypeReference(targetSrc, resolvedTypeInstance->mTypeDef);
|
||||||
|
|
||||||
BfTypedValue structInst;
|
BfTypedValue structInst;
|
||||||
|
mModule->PopulateType(resolvedTypeInstance);
|
||||||
if (!resolvedTypeInstance->IsValuelessType())
|
if (!resolvedTypeInstance->IsValuelessType())
|
||||||
{
|
{
|
||||||
if ((mReceivingValue != NULL) && (mReceivingValue->mType == resolvedTypeInstance) && (mReceivingValue->IsAddr()))
|
if ((mReceivingValue != NULL) && (mReceivingValue->mType == resolvedTypeInstance) && (mReceivingValue->IsAddr()))
|
||||||
|
|
|
@ -1721,6 +1721,7 @@ bool BfTypeInstance::IsValuelessType()
|
||||||
if (mTypeDef->mIsOpaque)
|
if (mTypeDef->mIsOpaque)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
BF_ASSERT(mDefineState >= BfTypeDefineState_Defined);
|
||||||
BF_ASSERT(mInstSize >= 0);
|
BF_ASSERT(mInstSize >= 0);
|
||||||
if (mInstSize == 0)
|
if (mInstSize == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -439,7 +439,7 @@ public:
|
||||||
virtual bool IsVoid() { return false; }
|
virtual bool IsVoid() { return false; }
|
||||||
virtual bool IsVoidPtr() { return false; }
|
virtual bool IsVoidPtr() { return false; }
|
||||||
virtual bool CanBeValuelessType() { return false; }
|
virtual bool CanBeValuelessType() { return false; }
|
||||||
virtual bool IsValuelessType() { BF_ASSERT(mSize != -1); return mSize == 0; }
|
virtual bool IsValuelessType() { BF_ASSERT(mSize != -1); BF_ASSERT(mDefineState >= BfTypeDefineState_Defined); return mSize == 0; }
|
||||||
virtual bool IsSelf() { return false; }
|
virtual bool IsSelf() { return false; }
|
||||||
virtual bool IsDot() { return false; }
|
virtual bool IsDot() { return false; }
|
||||||
virtual bool IsVar() { return false; }
|
virtual bool IsVar() { return false; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue