Skip to content

Commit 0b7382a

Browse files
[clr-interp] Fix abstract newobj test (#122624)
- Fix a test which should be throwing InvalidOperationException at call to newobj time, but calling into a JIT interface api just like the JIT Fixes Loader/classloader/generics/Instantiation/Negative/abstract01
1 parent e65cd58 commit 0b7382a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/interpreter/compiler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4388,6 +4388,12 @@ void InterpCompiler::EmitCall(CORINFO_RESOLVED_TOKEN* pConstrainedToken, bool re
43884388
m_ip += 5;
43894389
}
43904390

4391+
if (newObj)
4392+
{
4393+
// The jit is expected to call the getNewHelper api to trigger a set of validations
4394+
bool hasSideEffects = false;
4395+
m_compHnd->getNewHelper(resolvedCallToken.hClass, &hasSideEffects);
4396+
}
43914397

43924398
CORINFO_CALLINFO_FLAGS flags = (CORINFO_CALLINFO_FLAGS)(CORINFO_CALLINFO_ALLOWINSTPARAM | CORINFO_CALLINFO_SECURITYCHECKS | CORINFO_CALLINFO_DISALLOW_STUB);
43934399
if (isVirtual)

0 commit comments

Comments
 (0)