mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 15:46:05 +02:00
var
fixes
This commit is contained in:
parent
6708399691
commit
e5eb8b38eb
1 changed files with 11 additions and 6 deletions
|
@ -1909,7 +1909,7 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
|
|||
if (!initValue)
|
||||
initValue = GetDefaultTypedValue(localDef->mResolvedType);
|
||||
|
||||
if (!localDef->mResolvedType->IsValuelessType())
|
||||
if ((!localDef->mResolvedType->IsValuelessType()) && (!localDef->mResolvedType->IsVar()))
|
||||
localDef->mAddr = mBfIRBuilder->CreateGlobalVariable(mBfIRBuilder->MapType(localDef->mResolvedType, BfIRPopulateType_Full), false, BfIRLinkageType_Internal, initValue.mValue, name);;
|
||||
initHandled = true;
|
||||
}
|
||||
|
@ -6493,11 +6493,16 @@ void BfModule::DoForLess(BfForEachStatement* forEachStmt)
|
|||
// Soldier on
|
||||
target = GetDefaultTypedValue(varType);
|
||||
}
|
||||
|
||||
if (!target.mValue.IsFake())
|
||||
{
|
||||
if (forEachStmt->mInToken->mToken == BfToken_LessEquals)
|
||||
conditionValue = mBfIRBuilder->CreateCmpLTE(localVal, target.mValue, varType->IsSigned());
|
||||
else
|
||||
conditionValue = mBfIRBuilder->CreateCmpLT(localVal, target.mValue, varType->IsSigned());
|
||||
mBfIRBuilder->CreateCondBr(conditionValue, bodyBB, endBB);
|
||||
}
|
||||
|
||||
ValueScopeEnd(valueScopeStart);
|
||||
|
||||
mBfIRBuilder->AddBlock(bodyBB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue