1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Properly VisitLambdaBodies during inner methodRef capture

This commit is contained in:
Brian Fiete 2021-12-31 11:01:24 -05:00
parent 1201289f78
commit eae4aed3a9

View file

@ -12504,6 +12504,9 @@ BfLambdaInstance* BfExprEvaluator::GetLambdaInstance(BfLambdaBindExpression* lam
}
else if ((lambdaBindExpr->mNewToken == NULL) || (isFunctionBind))
{
if ((mModule->mCurMethodState != NULL) && (mModule->mCurMethodState->mClosureState != NULL) && (mModule->mCurMethodState->mClosureState->mCapturing))
VisitLambdaBodies(lambdaBindExpr->mBody, lambdaBindExpr->mDtor);
if ((lambdaBindExpr->mNewToken != NULL) && (isFunctionBind))
mModule->Fail("Binds to functions should do not require allocations.", lambdaBindExpr->mNewToken);