mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Merge pull request #2171 from aharabada/DeferCrash
Fixed crash when defer scope target doesn't exist
This commit is contained in:
commit
4deb97a484
1 changed files with 9 additions and 0 deletions
|
@ -7283,7 +7283,16 @@ void BfModule::Visit(BfDeferStatement* deferStmt)
|
|||
scope = &mCurMethodState->mHeadScope;
|
||||
}
|
||||
else if (deferStmt->mScopeName != NULL)
|
||||
{
|
||||
scope = FindScope(deferStmt->mScopeName, true);
|
||||
|
||||
if (scope == NULL)
|
||||
{
|
||||
AssertErrorState();
|
||||
// The scope doesn't exist, continue with the current scope so we still get an evaluation of the deferred code
|
||||
scope = mCurMethodState->mCurScope;
|
||||
}
|
||||
}
|
||||
else
|
||||
scope = mCurMethodState->mCurScope;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue