Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/coreclr/vm/methodtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4360,7 +4360,10 @@ void MethodTable::DoFullyLoad(Generics::RecursionGraph * const pVisited, const
ClassLoader::ValidateMethodsWithCovariantReturnTypes(this);
}

if ((level == CLASS_LOADED) && CORDisableJITOptimizations(this->GetModule()->GetDebuggerInfoBits()) && !HasInstantiation())
if ((level == CLASS_LOADED) &&
CORDisableJITOptimizations(this->GetModule()->GetDebuggerInfoBits()) &&
!HasInstantiation() &&
!GetModule()->GetAssembly()->IsLoading()) // Do not do this during the vtable fixup stage of C++/CLI assembly loading. See https://github.com/dotnet/runtime/issues/110365
{
if (g_fEEStarted)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ extern "C" DLL_EXPORT int __cdecl NativeEntryPoint()
}

#pragma managed

// Needed to provide a regression case for https://github.com/dotnet/runtime/issues/110365
[assembly:System::Diagnostics::DebuggableAttribute(true, true)];
[module:System::Diagnostics::DebuggableAttribute(true, true)];

public value struct ValueToReturnStorage
{
int valueToReturn;
bool valueSet;
};

// store the value to return in an appdomain local static variable to allow this test to be a regression test for https://github.com/dotnet/runtime/issues/110365
static __declspec(appdomain) ValueToReturnStorage s_valueToReturnStorage;

public ref class TestClass
{
private:
static int s_valueToReturn = 100;
public:
int ManagedEntryPoint()
{
Expand All @@ -29,12 +41,16 @@ public ref class TestClass

static void ChangeReturnedValue(int i)
{
s_valueToReturn = i;
s_valueToReturnStorage.valueToReturn = i;
s_valueToReturnStorage.valueSet = true;
}

static int GetReturnValue()
{
return s_valueToReturn;
if (s_valueToReturnStorage.valueSet)
return s_valueToReturnStorage.valueToReturn;
else
return 100;
}
};

Expand Down
Loading