Skip to content

Commit 4fab260

Browse files
authored
Fix CEE_NEWOBJ for generic types (#3183)
***NO_CI***
1 parent 16cd80b commit 4fab260

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CLR/Core/Interpreter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,10 @@ HRESULT CLR_RT_Thread::Execute_IL(CLR_RT_StackFrame &stackArg)
23782378
CLR_RT_HeapBlock *top;
23792379
CLR_INT32 changes;
23802380

2381-
cls.InitializeFromMethod(calleeInst); // This is the class to create!
2381+
if (!calleeInst.GetDeclaringType(cls))
2382+
{
2383+
NANOCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
2384+
}
23822385

23832386
evalPos++;
23842387

0 commit comments

Comments
 (0)