From d14db341b834cfb3c574a258c331b3a6b1c2cbc5 Mon Sep 17 00:00:00 2001 From: greg-lunarg Date: Fri, 18 Jan 2019 13:49:00 -0700 Subject: [PATCH] Invalidate ConstantManager if TypeManager is invalidated... (#2302) ...as the ConstantManager contains pointers into the TypeManager. --- source/opt/ir_context.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp index fe69027f8..a31349f45 100644 --- a/source/opt/ir_context.cpp +++ b/source/opt/ir_context.cpp @@ -127,6 +127,9 @@ void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) { constant_mgr_.reset(nullptr); } if (analyses_to_invalidate & kAnalysisTypes) { + // The ConstantManager contains Type pointers. If the TypeManager goes + // away, the ConstantManager has to go away. + constant_mgr_.reset(nullptr); type_mgr_.reset(nullptr); }