Skip to content

Commit b7a761c

Browse files
[clr-interp] Array allocation exception has incorrect exception (#120981)
- The actual helper throws the right exception (which is OverflowException) - Don't add an incorrect check
1 parent 3dc26a3 commit b7a761c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/coreclr/vm/interpexec.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,8 +2972,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
29722972
case INTOP_NEWARR:
29732973
{
29742974
int32_t length = LOCAL_VAR(ip[2], int32_t);
2975-
if (length < 0)
2976-
COMPlusThrow(kArgumentOutOfRangeException);
29772975

29782976
MethodTable* arrayClsHnd = (MethodTable*)pMethod->pDataItems[ip[3]];
29792977
HELPER_FTN_NEWARR helper = GetPossiblyIndirectHelper<HELPER_FTN_NEWARR>(pMethod, ip[4]);
@@ -2987,8 +2985,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
29872985
case INTOP_NEWARR_GENERIC:
29882986
{
29892987
int32_t length = LOCAL_VAR(ip[3], int32_t);
2990-
if (length < 0)
2991-
COMPlusThrow(kArgumentOutOfRangeException);
29922988

29932989
InterpGenericLookup *pLookup = (InterpGenericLookup*)&pMethod->pDataItems[ip[5]];
29942990
MethodTable *arrayClsHnd = (MethodTable*)DoGenericLookup(LOCAL_VAR(ip[2], void*), pLookup);

0 commit comments

Comments
 (0)