1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +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; bindResult.mWantsArgs = true;
SetAndRestoreValue<BfFunctionBindResult*> prevBindResult(mFunctionBindResult, &bindResult); SetAndRestoreValue<BfFunctionBindResult*> prevBindResult(mFunctionBindResult, &bindResult);
BfIRValue appendSizeValue; BfIRValue appendSizeValue;
//BfTypedValue emtpyThis(BfIRValue(), resolvedTypeRef, resolvedTypeRef->IsStruct());
BfTypedValue emtpyThis(mModule->mBfIRBuilder->GetFakeVal(), resolvedTypeRef, resolvedTypeRef->IsStruct()); BfTypedValue emtpyThis(mModule->mBfIRBuilder->GetFakeVal(), resolvedTypeRef, resolvedTypeRef->IsStruct());
BfResolvedArgs argValues(objCreateExpr->mOpenToken, &objCreateExpr->mArguments, &objCreateExpr->mCommas, objCreateExpr->mCloseToken); BfResolvedArgs argValues(objCreateExpr->mOpenToken, &objCreateExpr->mArguments, &objCreateExpr->mCommas, objCreateExpr->mCloseToken);
ResolveArgValues(argValues, BfResolveArgFlag_DeferParamEval); //// ResolveArgValues(argValues, BfResolveArgFlag_DeferParamEval); ////
/*SetAndRestoreValue<BfAttributeState*> prevAttributeState(mModule->mAttributeState, mPrefixedAttributeState);
if (mPrefixedAttributeState != NULL)
mPrefixedAttributeState->mUsed = true;*/
if (typeInstance == NULL) if (typeInstance == NULL)
{ {
// No CTOR needed // No CTOR needed
@ -11871,8 +11867,8 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
MatchConstructor(objCreateExpr->mTypeRef, objCreateExpr, emtpyThis, typeInstance, argValues, false, true); MatchConstructor(objCreateExpr->mTypeRef, objCreateExpr, emtpyThis, typeInstance, argValues, false, true);
if ((wasCapturingMethodInfo) && (!autoComplete->mIsCapturingMethodMatchInfo)) if ((wasCapturingMethodInfo) && (!autoComplete->mIsCapturingMethodMatchInfo))
{ {
autoComplete->mIsCapturingMethodMatchInfo = true; if (autoComplete->mMethodMatchInfo != NULL)
BF_ASSERT(autoComplete->mMethodMatchInfo != NULL); autoComplete->mIsCapturingMethodMatchInfo = true;
} }
else else
autoComplete->mIsCapturingMethodMatchInfo = false; autoComplete->mIsCapturingMethodMatchInfo = false;
@ -11883,14 +11879,7 @@ void BfExprEvaluator::Visit(BfObjectCreateExpression* objCreateExpr)
} }
mModule->ValidateAllocation(typeInstance, objCreateExpr->mTypeRef); mModule->ValidateAllocation(typeInstance, objCreateExpr->mTypeRef);
//prevAttributeState.Restore();
prevBindResult.Restore(); prevBindResult.Restore();
/*if ((typeInstance != NULL) && (bindResult.mMethodInstance == NULL))
{
mModule->AssertErrorState();
return;
}*/
int allocAlign = resolvedTypeRef->mAlign; int allocAlign = resolvedTypeRef->mAlign;
if (typeInstance != NULL) if (typeInstance != NULL)