From 4560924608f47e360d4dfc1512ded7c4f530d873 Mon Sep 17 00:00:00 2001 From: Manodasan Wignarajah Date: Fri, 23 Jul 2021 23:40:32 -0700 Subject: [PATCH] Fix heap corruption. (#923) --- src/cswinrt/code_writers.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cswinrt/code_writers.h b/src/cswinrt/code_writers.h index bd45d772d..00bcef0b3 100644 --- a/src/cswinrt/code_writers.h +++ b/src/cswinrt/code_writers.h @@ -6536,7 +6536,8 @@ bind(invokeMethodSig)); { auto&& eventTypeSemantics = get_type_semantics(eventObj.EventType()); auto&& eventTypeCode = w.write_temp("%", bind(eventTypeSemantics, typedef_name_type::Projected, false)); - typeNameToDefinitionMap[eventTypeCode] = w.write_temp("%", bind(eventTypeSemantics)); + auto&& eventClass = w.write_temp("%", bind(eventTypeSemantics)); + typeNameToDefinitionMap[eventTypeCode] = eventClass; } }); } @@ -6548,7 +6549,8 @@ bind(invokeMethodSig)); { auto&& eventTypeSemantics = get_type_semantics(eventObj.EventType()); auto&& eventTypeCode = w.write_temp("%", bind(eventTypeSemantics, typedef_name_type::Projected, false)); - typeNameToDefinitionMap[eventTypeCode] = w.write_temp("%", bind(eventTypeSemantics)); + auto&& eventClass = w.write_temp("%", bind(eventTypeSemantics)); + typeNameToDefinitionMap[eventTypeCode] = eventClass; } } }