mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Zero out typed primitives in ctor
This commit is contained in:
parent
209f11836e
commit
ed99fb9bdf
1 changed files with 7 additions and 1 deletions
|
@ -16578,6 +16578,12 @@ void BfModule::EmitCtorBody(bool& skipBody)
|
|||
|
||||
bool calledCtorNoBody = false;
|
||||
|
||||
if ((mCurTypeInstance->IsTypedPrimitive()) && (!mCurTypeInstance->IsValuelessType()))
|
||||
{
|
||||
// Zero out typed primitives in ctor
|
||||
mBfIRBuilder->CreateStore(GetDefaultValue(mCurTypeInstance->GetUnderlyingType()), mBfIRBuilder->GetArgument(0));
|
||||
}
|
||||
|
||||
if ((!mCurTypeInstance->IsBoxed()) && (methodDef->mMethodType == BfMethodType_Ctor) && (!hadThisInitializer))
|
||||
{
|
||||
// Call the root type's default ctor (with no body) to initialize its fields and call the chained ctors
|
||||
|
@ -17039,7 +17045,7 @@ void BfModule::EmitCtorBody(bool& skipBody)
|
|||
else
|
||||
autoComplete->mIsCapturingMethodMatchInfo = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BfModule::EmitEnumToStringBody()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue