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

PopulateGlobalContainersList activeTypeDef fix

This commit is contained in:
Brian Fiete 2025-01-08 10:35:53 -08:00
parent bda65a8774
commit 85fcca9c76
2 changed files with 15 additions and 5 deletions

View file

@ -3950,11 +3950,7 @@ void BfModule::PopulateGlobalContainersList(const BfGlobalLookup& globalLookup)
BP_ZONE("PopulateGlobalContainersList"); BP_ZONE("PopulateGlobalContainersList");
BfTypeDef* userTypeDef = mContext->mCurTypeState->mCurTypeDef; BfTypeDef* userTypeDef = GetActiveTypeDef();
if ((userTypeDef == NULL) && (mCurMethodInstance != NULL))
userTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
if (userTypeDef == NULL)
userTypeDef = mCurTypeInstance->mTypeDef;
if (mContext->mCurTypeState->mGlobalContainerCurUserTypeDef != userTypeDef) if (mContext->mCurTypeState->mGlobalContainerCurUserTypeDef != userTypeDef)
{ {

View file

@ -1,9 +1,21 @@
using System; using System;
namespace Other
{
static
{
public const int sOther1 = 123;
}
}
using Other;
namespace Tests namespace Tests
{ {
class Globals class Globals
{ {
static uint8[sOther1] sArr;
public struct StructA : this(int64 a, int32 b) public struct StructA : this(int64 a, int32 b)
{ {
} }
@ -73,6 +85,8 @@ namespace Tests
Test.Assert(LibSpace.MethodA() == 100); Test.Assert(LibSpace.MethodA() == 100);
Test.Assert(LibSpace.MethodB() == 200); Test.Assert(LibSpace.MethodB() == 200);
Test.Assert(sArr.Count == 123);
} }
} }
} }