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

Fixes to raw array delete marking

This commit is contained in:
Brian Fiete 2022-01-25 12:05:15 -05:00
parent f3cef1456a
commit 0b47f755d8
3 changed files with 5 additions and 2 deletions

View file

@ -9108,7 +9108,7 @@ BfIRValue BfModule::AllocFromType(BfType* type, const BfAllocTarget& allocTarget
for (int i = 1; i < deferredCall->mModuleMethodInstance.mMethodInstance->GetParamCount(); i++)
{
auto scopedArg = deferredCall->mScopeArgs[i];
if (!scopedArg.IsConst())
if (scopedArg != deferredCall->mOrigScopeArgs[i])
mBfIRBuilder->CreateStore(GetDefaultValue(deferredCall->mModuleMethodInstance.mMethodInstance->GetParamType(i)), deferredCall->mScopeArgs[i]);
}
}

View file

@ -282,7 +282,8 @@ public:
BfTypedValue mTarget;
BfModuleMethodInstance mModuleMethodInstance;
BfIRValue mDeferredAlloca;
SizedArray<BfIRValue, 1> mScopeArgs;
SizedArray<BfIRValue, 2> mOrigScopeArgs;
SizedArray<BfIRValue, 2> mScopeArgs;
Array<BfDeferredCapture> mCaptures;
BfBlock* mDeferredBlock;
BfAstNode* mEmitRefNode;

View file

@ -64,6 +64,8 @@ bool BfModule::AddDeferredCallEntry(BfDeferredCallEntry* deferredCallEntry, BfSc
if (mCurMethodState->mPendingNullConditional != NULL)
isDyn = true;
deferredCallEntry->mOrigScopeArgs = deferredCallEntry->mScopeArgs;
if (!isDyn)
{
mCurMethodState->mCurScope->ClearHandlers(scopeData);