mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Defer fix for typed primitive/valueless target
This commit is contained in:
parent
7206038cc5
commit
b9647d2a08
2 changed files with 30 additions and 4 deletions
|
@ -399,10 +399,10 @@ bool BfModule::AddDeferredCallEntry(BfDeferredCallEntry* deferredCallEntry, BfSc
|
|||
|
||||
int dataIdx = 2;
|
||||
int argIdx = 0;
|
||||
if (!methodDef->mIsStatic)
|
||||
if ((!methodDef->mIsStatic) && (!owningType->IsValuelessType()))
|
||||
{
|
||||
gepInstance = mBfIRBuilder->CreateInBoundsGEP(deferredAlloca, 0, 2);
|
||||
if (owningType->IsStruct())
|
||||
if (owningType->IsValueType())
|
||||
{
|
||||
if ((!methodDef->mIsMutating) && (owningType->IsSplattable()))
|
||||
{
|
||||
|
@ -1172,7 +1172,7 @@ void BfModule::EmitDeferredCallProcessor(BfScopeData* scopeData, SLIList<BfDefer
|
|||
if ((argIdx == 0) && (!methodDef->mIsStatic))
|
||||
{
|
||||
// 'this'
|
||||
isStruct = methodOwner->IsStruct();
|
||||
isStruct = methodOwner->IsValueType();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1750,7 +1750,7 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
|
|||
BfExprEvaluator valExprEvaluator(this);
|
||||
valExprEvaluator.mAllowReadOnlyReference = isReadOnly;
|
||||
initValue = CreateValueFromExpression(valExprEvaluator, varDecl->mInitializer, expectedType, (BfEvalExprFlags)(BfEvalExprFlags_NoCast | BfEvalExprFlags_AllowRefExpr | BfEvalExprFlags_VariableDeclaration));
|
||||
|
||||
|
||||
if ((initValue) && (resolvedType->IsUndefSizedArray()))
|
||||
{
|
||||
int stringId = GetStringPoolIdx(initValue.mValue, mBfIRBuilder);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue