From 85c9a6ebc85768adbdab0cf0211b702952505ff0 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 11 Feb 2021 09:19:34 -0800 Subject: [PATCH] Fixed global var TLS issue --- IDEHelper/Compiler/BfIRBuilder.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/IDEHelper/Compiler/BfIRBuilder.cpp b/IDEHelper/Compiler/BfIRBuilder.cpp index 09d6927c..427f6c9d 100644 --- a/IDEHelper/Compiler/BfIRBuilder.cpp +++ b/IDEHelper/Compiler/BfIRBuilder.cpp @@ -4734,10 +4734,8 @@ void BfIRBuilder::CreateGlobalVariable(BfIRValue irValue) { auto globalVar = (BfGlobalVar*)GetConstant(irValue); - if (!mIgnoreWrites) + if ((!mIgnoreWrites) && (globalVar->mStreamId == -1)) { - BF_ASSERT(globalVar->mStreamId == -1); - if (globalVar->mInitializer) 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) { - auto irValue = CreateGlobalVariableConstant(varType, isConstant, linkageType, initializer, name); + auto irValue = CreateGlobalVariableConstant(varType, isConstant, linkageType, initializer, name, isTLS); CreateGlobalVariable(irValue); return irValue; }