1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Marking default ctors as illegal src positions

This commit is contained in:
Brian Fiete 2020-02-01 11:42:32 -08:00
parent 034a9faf97
commit 3da6535ef5

View file

@ -2291,6 +2291,7 @@ void BfModule::UpdateExprSrcPos(BfAstNode* astNode, BfSrcPosFlags flags)
void BfModule::UseDefaultSrcPos(BfSrcPosFlags flags, int debugLocOffset)
{
UpdateSrcPos(mCompiler->mBfObjectTypeDef->mTypeDeclaration, flags, debugLocOffset);
SetIllegalSrcPos();
}
void BfModule::SetIllegalSrcPos(BfSrcPosFlags flags)
@ -14200,6 +14201,11 @@ void BfModule::EmitCtorBody(bool& skipBody)
}
}
if (mCurTypeInstance->IsDelegate())
{
NOP;
}
BfAstNode* baseCtorNode = NULL;
if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL) && (ctorDeclaration->mInitializer->mTarget != NULL))
baseCtorNode = ctorDeclaration->mInitializer->mTarget;
@ -14300,6 +14306,10 @@ void BfModule::EmitCtorBody(bool& skipBody)
if ((mBfIRBuilder->DbgHasInfo()) && (!mCurTypeInstance->IsUnspecializedType()) && (mHasFullDebugInfo))
{
UpdateSrcPos(baseCtorNode);
if (methodDef->mBody == NULL)
SetIllegalSrcPos();
// NOP so we step onto the open paren of the method so we can choose to set into the field initializers or step over them
EmitEnsureInstructionAt();
@ -14416,6 +14426,8 @@ void BfModule::EmitCtorBody(bool& skipBody)
if (baseCtorNode != NULL)
{
UpdateSrcPos(baseCtorNode);
if (methodDef->mBody == NULL)
SetIllegalSrcPos();
}
if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL))
{