mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed const-eval-initialized const field dependency issues
This commit is contained in:
parent
1893988195
commit
496eae24ad
5 changed files with 85 additions and 29 deletions
|
@ -4088,6 +4088,10 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
|
|||
}
|
||||
else if (fieldDef->mIsConst)
|
||||
{
|
||||
int ceExecuteId = -1;
|
||||
if (mCompiler->mCEMachine != NULL)
|
||||
ceExecuteId = mCompiler->mCEMachine->mExecuteId;
|
||||
|
||||
BfTypeState typeState;
|
||||
typeState.mTypeInstance = mCurTypeInstance;
|
||||
typeState.mCurTypeDef = fieldDef->mDeclaringType;
|
||||
|
@ -4108,8 +4112,14 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
|
|||
resolveFlags = BfConstResolveFlag_NoCast;
|
||||
}
|
||||
UpdateSrcPos(initializer);
|
||||
return constResolver.Resolve(initializer, fieldType, resolveFlags);
|
||||
}
|
||||
auto result = constResolver.Resolve(initializer, fieldType, resolveFlags);
|
||||
if (mCompiler->mCEMachine != NULL)
|
||||
{
|
||||
if (mCompiler->mCEMachine->mExecuteId != ceExecuteId)
|
||||
fieldInstance->mHadConstEval = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
BfExprEvaluator exprEvaluator(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue