mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixes for increment/decrement operators
This commit is contained in:
parent
37576d389c
commit
bb87ca7b52
2 changed files with 45 additions and 5 deletions
|
@ -18295,14 +18295,28 @@ BfTypedValue BfExprEvaluator::PerformUnaryOperation_TryOperator(const BfTypedVal
|
|||
result = mModule->GetDefaultTypedValue(methodMatcher.mSelfType);
|
||||
}
|
||||
|
||||
if ((methodMatcher.mBestMethodInstance) && (methodMatcher.mBestMethodInstance.mMethodInstance->mIsIntrinsic) &&
|
||||
if ((methodMatcher.mBestMethodInstance) &&
|
||||
((findOp == BfUnaryOp_Increment) || (findOp == BfUnaryOp_Decrement)))
|
||||
{
|
||||
if (args[0].mTypedValue.IsAddr())
|
||||
mModule->mBfIRBuilder->CreateStore(result.mValue, args[0].mTypedValue.mValue);
|
||||
else
|
||||
if (methodMatcher.mBestMethodInstance.mMethodInstance->mIsIntrinsic)
|
||||
{
|
||||
mModule->AssertErrorState();
|
||||
if (args[0].mTypedValue.IsAddr())
|
||||
mModule->mBfIRBuilder->CreateStore(result.mValue, args[0].mTypedValue.mValue);
|
||||
else
|
||||
{
|
||||
mModule->AssertErrorState();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!result.mType->IsValuelessType())
|
||||
{
|
||||
if (targetVal.IsAddr())
|
||||
{
|
||||
result = mModule->LoadValue(result);
|
||||
mModule->mBfIRBuilder->CreateStore(result.mValue, targetVal.mValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue