From da428d2c50aa5dc5c237b0c59b2843f83dff395b Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 2 Nov 2021 09:57:03 -0700 Subject: [PATCH] Record mUnreifiedStringPoolRefs in correct owner module --- IDEHelper/Compiler/BfModule.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index f0696de2..16481e93 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -1734,7 +1734,10 @@ BfIRValue BfModule::GetStringObjectValue(const StringImpl& str, bool define, boo if ((mBfIRBuilder->mIgnoreWrites) && (!force)) { - mUnreifiedStringPoolRefs.Add(strId); + auto refModule = this; + if ((this == mContext->mUnreifiedModule) && (mCurTypeInstance != NULL)) + refModule = mCurTypeInstance->mModule; + refModule->mUnreifiedStringPoolRefs.Add(strId); return mBfIRBuilder->CreateConst(BfTypeCode_StringId, strId); }