mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed comptime reflection reentrancy issue with StringView
This commit is contained in:
parent
382ecdd750
commit
6cce0ffc25
1 changed files with 6 additions and 6 deletions
|
@ -1811,7 +1811,7 @@ BfIRValue BfModule::GetStringObjectValue(const StringImpl& str, bool define, boo
|
|||
}
|
||||
|
||||
BfIRValue* irValuePtr = NULL;
|
||||
if (!mStringObjectPool.TryAdd(strId, NULL, &irValuePtr))
|
||||
if (mStringObjectPool.TryGetValue(strId, &irValuePtr))
|
||||
return *irValuePtr;
|
||||
|
||||
// If this wasn't in neither dictionary yet, add to mStringPoolRefs
|
||||
|
@ -1819,8 +1819,8 @@ BfIRValue BfModule::GetStringObjectValue(const StringImpl& str, bool define, boo
|
|||
mStringPoolRefs.Add(strId);
|
||||
|
||||
BfIRValue strObject = CreateStringObjectValue(str, strId, define);
|
||||
mStringObjectPool[strId] = strObject;
|
||||
|
||||
*irValuePtr = strObject;
|
||||
mStringPoolRefs.Add(strId);
|
||||
|
||||
return strObject;
|
||||
|
@ -5161,7 +5161,7 @@ BfIRValue BfModule::CreateClassVDataGlobal(BfTypeInstance* typeInstance, int* ou
|
|||
if (mBfIRBuilder->mIgnoreWrites)
|
||||
return mBfIRBuilder->GetFakeVal();
|
||||
|
||||
PopulateType(typeInstance, BfPopulateType_DataAndMethods);
|
||||
PopulateType(typeInstance, mIsComptimeModule ? BfPopulateType_Data : BfPopulateType_DataAndMethods);
|
||||
|
||||
BfType* classVDataType = ResolveTypeDef(mCompiler->mClassVDataTypeDef);
|
||||
|
||||
|
@ -5706,7 +5706,7 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
|||
else
|
||||
typeDataSource = mContext->mBfTypeType;
|
||||
|
||||
if ((!mTypeDataRefs.ContainsKey(typeDataSource)) && (typeDataSource != type))
|
||||
if ((!mTypeDataRefs.ContainsKey(typeDataSource)) && (typeDataSource != type) && (!mIsComptimeModule))
|
||||
{
|
||||
CreateTypeData(typeDataSource, usedStringIdMap, false, true, needsTypeNames, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue