From a9e9b23704833bc95c3a3cce37a8deda59adac40 Mon Sep 17 00:00:00 2001 From: Fadi Hanna Date: Thu, 22 Aug 2019 04:31:08 -0700 Subject: [PATCH] Fix issue with local getting out of scope (dotnet/coreclr#25708) Commit migrated from https://github.com/dotnet/coreclr/commit/47a155800eecb965e7f49e19f6109e93f370716c --- src/coreclr/src/vm/interoputil.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/interoputil.cpp b/src/coreclr/src/vm/interoputil.cpp index 68c676e..f67a971 100644 --- a/src/coreclr/src/vm/interoputil.cpp +++ b/src/coreclr/src/vm/interoputil.cpp @@ -5811,6 +5811,7 @@ MethodDesc *WinRTInterfaceRedirector::GetStubMethodForRedirectedInterface(WinMDA // Verify that the signature of the stub method matches the corresponding interface method. MethodTable *pItfMT = NULL; Instantiation inst = pMD->GetMethodInstantiation(); + TypeHandle thKvPair; if (interopKind == TypeHandle::Interop_NativeToManaged) { @@ -5832,8 +5833,8 @@ MethodDesc *WinRTInterfaceRedirector::GetStubMethodForRedirectedInterface(WinMDA if (interfaceIndex == WinMDAdapter::RedirectedTypeIndex_System_Collections_Generic_IDictionary || interfaceIndex == WinMDAdapter::RedirectedTypeIndex_System_Collections_Generic_IReadOnlyDictionary) - { - TypeHandle thKvPair = TypeHandle(MscorlibBinder::GetClass(CLASS__KEYVALUEPAIRGENERIC)).Instantiate(inst); + { + thKvPair = TypeHandle(MscorlibBinder::GetClass(CLASS__KEYVALUEPAIRGENERIC)).Instantiate(inst); inst = Instantiation(&thKvPair, 1); } } -- 2.7.4