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

Fix for literal int int expression block, fixed lifetime

This commit is contained in:
Brian Fiete 2021-09-12 18:14:22 -07:00
parent 723e2177fc
commit 484a0bf375

View file

@ -3409,7 +3409,9 @@ void BfModule::VisitCodeBlock(BfBlock* block)
if ((exprEvaluator->mResult) && (!exprEvaluator->mResult.mType->IsValuelessType()) && (!exprEvaluator->mResult.IsAddr()))
{
// We need to make sure we don't retain any values through the scope's ValueScopeHardEnd
FixIntUnknown(exprEvaluator->mResult, exprEvaluator->mExpectingType);
// We need to make sure we don't retain any values through the scope's ValueScopeHardEnd - and extend alloca through previous scope
SetAndRestoreValue<BfScopeData*> prevScope(mCurMethodState->mCurScope, mCurMethodState->mCurScope->mPrevScope);
exprEvaluator->mResult = MakeAddressable(exprEvaluator->mResult);
}
}