mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Made paths with NoReturn calls mark variables as assigned
This commit is contained in:
parent
502c46dc2f
commit
8d0a415eb7
3 changed files with 7 additions and 5 deletions
|
@ -5605,6 +5605,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
|
|||
{
|
||||
mModule->mCurMethodState->SetHadReturn(true);
|
||||
mModule->mCurMethodState->mLeftBlockUncond = true;
|
||||
mModule->MarkScopeLeft(&mModule->mCurMethodState->mHeadScope, true);
|
||||
}
|
||||
|
||||
if (mModule->mCurTypeInstance != NULL)
|
||||
|
|
|
@ -15519,9 +15519,9 @@ void BfModule::EmitDeferredScopeCalls(bool useSrcPositions, BfScopeData* scopeDa
|
|||
}*/
|
||||
}
|
||||
|
||||
void BfModule::MarkScopeLeft(BfScopeData* scopeData)
|
||||
{
|
||||
if (mCurMethodState->mDeferredLocalAssignData != NULL)
|
||||
void BfModule::MarkScopeLeft(BfScopeData* scopeData, bool isNoReturn)
|
||||
{
|
||||
if ((mCurMethodState->mDeferredLocalAssignData != NULL) && (!isNoReturn))
|
||||
{
|
||||
auto deferredLocalAssignData = mCurMethodState->mDeferredLocalAssignData;
|
||||
|
||||
|
@ -15550,7 +15550,8 @@ void BfModule::MarkScopeLeft(BfScopeData* scopeData)
|
|||
}
|
||||
if (!hadAssignment)
|
||||
{
|
||||
localDef->mHadExitBeforeAssign = true;
|
||||
if (!isNoReturn)
|
||||
localDef->mHadExitBeforeAssign = true;
|
||||
mCurMethodState->LocalDefined(localDef);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1845,7 +1845,7 @@ public:
|
|||
void ClearLifetimeEnds();
|
||||
bool HasDeferredScopeCalls(BfScopeData* scope);
|
||||
void EmitDeferredScopeCalls(bool useSrcPositions, BfScopeData* scope, BfIRBlock doneBlock = BfIRBlock());
|
||||
void MarkScopeLeft(BfScopeData* scopeData);
|
||||
void MarkScopeLeft(BfScopeData* scopeData, bool isNoReturn = false);
|
||||
BfGenericParamType* GetGenericParamType(BfGenericParamKind paramKind, int paramIdx);
|
||||
BfType* ResolveGenericType(BfType* unspecializedType, BfTypeVector* typeGenericArguments, BfTypeVector* methodGenericArguments, bool allowFail = false);
|
||||
BfType* ResolveSelfType(BfType* type, BfTypeInstance* selfType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue