1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed crash with embedded aborted autocomplete methodInfo

This commit is contained in:
Brian Fiete 2020-06-01 05:16:26 -07:00
parent 4fe4bcc342
commit fa3914e674

View file

@ -11846,16 +11846,12 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
bindResult.mWantsArgs = true;
SetAndRestoreValue<BfFunctionBindResult*> prevBindResult(mFunctionBindResult, &bindResult);
BfIRValue appendSizeValue;
//BfTypedValue emtpyThis(BfIRValue(), resolvedTypeRef, resolvedTypeRef->IsStruct());
BfIRValue appendSizeValue;
BfTypedValue emtpyThis(mModule->mBfIRBuilder->GetFakeVal(), resolvedTypeRef, resolvedTypeRef->IsStruct());
BfResolvedArgs argValues(objCreateExpr->mOpenToken, &objCreateExpr->mArguments, &objCreateExpr->mCommas, objCreateExpr->mCloseToken);
ResolveArgValues(argValues, BfResolveArgFlag_DeferParamEval); ////
/*SetAndRestoreValue<BfAttributeState*> prevAttributeState(mModule->mAttributeState, mPrefixedAttributeState);
if (mPrefixedAttributeState != NULL)
mPrefixedAttributeState->mUsed = true;*/
if (typeInstance == NULL)
{
// No CTOR needed
@ -11871,8 +11867,8 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
MatchConstructor(objCreateExpr->mTypeRef, objCreateExpr, emtpyThis, typeInstance, argValues, false, true);
if ((wasCapturingMethodInfo) && (!autoComplete->mIsCapturingMethodMatchInfo))
{
autoComplete->mIsCapturingMethodMatchInfo = true;
BF_ASSERT(autoComplete->mMethodMatchInfo != NULL);
if (autoComplete->mMethodMatchInfo != NULL)
autoComplete->mIsCapturingMethodMatchInfo = true;
}
else
autoComplete->mIsCapturingMethodMatchInfo = false;
@ -11883,14 +11879,7 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
}
mModule->ValidateAllocation(typeInstance, objCreateExpr->mTypeRef);
//prevAttributeState.Restore();
prevBindResult.Restore();
/*if ((typeInstance != NULL) && (bindResult.mMethodInstance == NULL))
{
mModule->AssertErrorState();
return;
}*/
int allocAlign = resolvedTypeRef->mAlign;
if (typeInstance != NULL)