1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-22 09:38:01 +02:00

Allow extending Object and ValueType

This commit is contained in:
Brian Fiete 2022-01-06 06:27:39 -05:00
parent 0826b6d49f
commit 54dc59e049
6 changed files with 126 additions and 22 deletions

View file

@ -6580,7 +6580,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
}
else
{
auto lengthValAddr = mBfIRBuilder->CreateInBoundsGEP(arrayBaseValue, 0, 1);
auto lengthValAddr = mBfIRBuilder->CreateInBoundsGEP(arrayBaseValue, 0, GetFieldDataIdx(arrayType->mBaseType, 0, "mLength"));
lengthVal = mBfIRBuilder->CreateLoad(lengthValAddr);
}
lengthVal = mBfIRBuilder->CreateNumericCast(lengthVal, true, BfTypeCode_IntPtr);