diff --git a/src/coreclr/interpreter/compiler.cpp b/src/coreclr/interpreter/compiler.cpp index e7884e486c5820..3ece0522fe88eb 100644 --- a/src/coreclr/interpreter/compiler.cpp +++ b/src/coreclr/interpreter/compiler.cpp @@ -3668,6 +3668,13 @@ bool InterpCompiler::EmitNamedIntrinsicCall(NamedIntrinsic ni, bool nonVirtualCa // These intrinsics are handled in the il peeps path, and do not need to produce warnings here. return false; + case NI_System_StubHelpers_NextCallReturnAddress: + // This intrinsic can only reach here if it is not followed by a POP, and in that case it is not supported by the interpreter. + // So we must skip compiling it. It should only appear in the case of tail-call stubs, and those are currently only supported by the JIT, so + // we presumably have a JIT available to implement this intrinsic. + SKIPCODE("NextCallReturnAddress intrinsic not supported in interpreter when not followed by POP"); + return false; + default: { FAIL_TO_EXPAND_INTRINSIC: diff --git a/src/coreclr/interpreter/eeinterp.cpp b/src/coreclr/interpreter/eeinterp.cpp index eecd55c651b5ee..d9b7366981a3fc 100644 --- a/src/coreclr/interpreter/eeinterp.cpp +++ b/src/coreclr/interpreter/eeinterp.cpp @@ -190,6 +190,13 @@ INTERPRETER_NORETURN void BADCODE(const char* message) throw InterpException(message, CORJIT_BADCODE); } +INTERPRETER_NORETURN void SKIPCODE(const char* message) +{ + if (IsInterpDumpActive()) + printf("Skip during interpreter method compilation: %s\n", message ? message : "unknown error"); + throw InterpException(message, CORJIT_SKIPPED); +} + INTERPRETER_NORETURN void NOMEM() { throw InterpException(NULL, CORJIT_OUTOFMEM); diff --git a/src/coreclr/interpreter/failures.h b/src/coreclr/interpreter/failures.h index 9532b7bfba0c45..690aa3f2b201d0 100644 --- a/src/coreclr/interpreter/failures.h +++ b/src/coreclr/interpreter/failures.h @@ -13,5 +13,6 @@ INTERPRETER_NORETURN void NO_WAY(const char* message); INTERPRETER_NORETURN void BADCODE(const char* message); INTERPRETER_NORETURN void NOMEM(); +INTERPRETER_NORETURN void SKIPCODE(const char* message); #endif