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

Wasm calling convention fixes. IDEHelper/Tests runs on wasm now.

This commit is contained in:
Brian Fiete 2024-10-25 11:20:01 -04:00
parent c0ebcc8fda
commit 31746c1f19
12 changed files with 99 additions and 13 deletions

View file

@ -14018,7 +14018,14 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr)
else if ((closureTypeInst != NULL) && (captureThisByValue))
{
// When we need to aggregrate a splat for a target, we just point out delegate's mTarget to inside ourselves where we aggregated the value
auto fieldPtr = mModule->mBfIRBuilder->CreateInBoundsGEP(mResult.mValue, 0, 1);
int dataIdx = 1;
if (!closureTypeInst->mFieldInstances.IsEmpty())
{
auto& fieldInst = closureTypeInst->mFieldInstances[0];
BF_ASSERT(fieldInst.GetFieldDef()->mName == "__this");
dataIdx = fieldInst.mDataIdx;
}
auto fieldPtr = mModule->mBfIRBuilder->CreateInBoundsGEP(mResult.mValue, 0, dataIdx);
target = mModule->LoadValue(target);
mModule->mBfIRBuilder->CreateStore(target.mValue, fieldPtr);
target = BfTypedValue(fieldPtr, target.mType, true);