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

Fixed global var TLS issue

This commit is contained in:
Brian Fiete 2021-02-11 09:19:34 -08:00
parent 1c14177638
commit 85c9a6ebc8

View file

@ -4734,10 +4734,8 @@ void BfIRBuilder::CreateGlobalVariable(BfIRValue irValue)
{ {
auto globalVar = (BfGlobalVar*)GetConstant(irValue); auto globalVar = (BfGlobalVar*)GetConstant(irValue);
if (!mIgnoreWrites) if ((!mIgnoreWrites) && (globalVar->mStreamId == -1))
{ {
BF_ASSERT(globalVar->mStreamId == -1);
if (globalVar->mInitializer) if (globalVar->mInitializer)
mHasGlobalDefs = true; mHasGlobalDefs = true;
@ -4776,7 +4774,7 @@ BfIRValue BfIRConstHolder::CreateGlobalVariableConstant(BfIRType varType, bool i
BfIRValue BfIRBuilder::CreateGlobalVariable(BfIRType varType, bool isConstant, BfIRLinkageType linkageType, BfIRValue initializer, const StringImpl& name, bool isTLS) BfIRValue BfIRBuilder::CreateGlobalVariable(BfIRType varType, bool isConstant, BfIRLinkageType linkageType, BfIRValue initializer, const StringImpl& name, bool isTLS)
{ {
auto irValue = CreateGlobalVariableConstant(varType, isConstant, linkageType, initializer, name); auto irValue = CreateGlobalVariableConstant(varType, isConstant, linkageType, initializer, name, isTLS);
CreateGlobalVariable(irValue); CreateGlobalVariable(irValue);
return irValue; return irValue;
} }