mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed MapType issue with global var
This commit is contained in:
parent
cffd849045
commit
1c14177638
2 changed files with 8 additions and 1 deletions
|
@ -691,6 +691,8 @@ void BeIRCodeGen::Read(BeValue*& beValue)
|
||||||
CMD_PARAM(String, name);
|
CMD_PARAM(String, name);
|
||||||
CMD_PARAM(bool, isTLS);
|
CMD_PARAM(bool, isTLS);
|
||||||
|
|
||||||
|
BF_ASSERT(varType != NULL);
|
||||||
|
|
||||||
auto globalVariable = mBeModule->mGlobalVariables.Alloc();
|
auto globalVariable = mBeModule->mGlobalVariables.Alloc();
|
||||||
globalVariable->mModule = mBeModule;
|
globalVariable->mModule = mBeModule;
|
||||||
globalVariable->mType = varType;
|
globalVariable->mType = varType;
|
||||||
|
@ -1908,6 +1910,8 @@ void BeIRCodeGen::HandleNextCmd()
|
||||||
CMD_PARAM(bool, isTLS);
|
CMD_PARAM(bool, isTLS);
|
||||||
CMD_PARAM(BeConstant*, initializer);
|
CMD_PARAM(BeConstant*, initializer);
|
||||||
|
|
||||||
|
BF_ASSERT(varType != NULL);
|
||||||
|
|
||||||
auto globalVariable = mBeModule->mGlobalVariables.Alloc();
|
auto globalVariable = mBeModule->mGlobalVariables.Alloc();
|
||||||
globalVariable->mModule = mBeModule;
|
globalVariable->mModule = mBeModule;
|
||||||
globalVariable->mType = varType;
|
globalVariable->mType = varType;
|
||||||
|
|
|
@ -13725,8 +13725,11 @@ BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
|
||||||
|
|
||||||
auto globalVar = (BfGlobalVar*)mBfIRBuilder->GetConstant(globalValue);
|
auto globalVar = (BfGlobalVar*)mBfIRBuilder->GetConstant(globalValue);
|
||||||
if ((globalVar->mStreamId == -1) && (!mBfIRBuilder->mIgnoreWrites))
|
if ((globalVar->mStreamId == -1) && (!mBfIRBuilder->mIgnoreWrites))
|
||||||
|
{
|
||||||
|
mBfIRBuilder->MapType(fieldInstance->mResolvedType);
|
||||||
mBfIRBuilder->CreateGlobalVariable(globalValue);
|
mBfIRBuilder->CreateGlobalVariable(globalValue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
StringT<128> staticVarName;
|
StringT<128> staticVarName;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue