From ff1143db68f5ea59b01a799d5cb1c2a4b0ba999b Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Tue, 23 Sep 2025 10:09:58 -0700 Subject: [PATCH] [clr-interp] InterpreterJitManager::ResolveEHClause behaved incorrectly - We need to use IsCanonicalSubtype, not IsSharedByGenericInstantiations as IsSharedByGenericInstantiations returns false for System.__Canon. - This caused an issue where shared generic catch did not work correctly for methods which simply attempted to catch T, not a more complex generic type. --- src/coreclr/vm/codeman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp index da9907b67e3574..fae188a904282d 100644 --- a/src/coreclr/vm/codeman.cpp +++ b/src/coreclr/vm/codeman.cpp @@ -3371,7 +3371,7 @@ TypeHandle InterpreterJitManager::ResolveEHClause(EE_ILEXCEPTION_CLAUSE* pEHClau TypeHandle thResolved = EECodeGenManager::ResolveEHClause(pEHClause, pCf); - if (thResolved.IsSharedByGenericInstantiations()) + if (thResolved.IsCanonicalSubtype()) { _ASSERTE(!HasCachedTypeHandle(pEHClause));