From e100af592b7f78166ba867bf4f9b151d3adece08 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 1 Feb 2018 16:55:59 +0100 Subject: Fix for rematerializer. --- libjulia/optimiser/Rematerialiser.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libjulia/optimiser/Rematerialiser.cpp') diff --git a/libjulia/optimiser/Rematerialiser.cpp b/libjulia/optimiser/Rematerialiser.cpp index 09a9bb90..bf7d7d16 100644 --- a/libjulia/optimiser/Rematerialiser.cpp +++ b/libjulia/optimiser/Rematerialiser.cpp @@ -136,6 +136,10 @@ void Rematerialiser::handleAssignment(set const& _variables, Expression* else m_substitutions.erase(name); } + else + for (auto const& name: _variables) + m_substitutions.erase(name); + // Disallow substitutions that use a variable that will be reassigned by this assignment. for (auto const& name: _variables) for (auto const& ref: m_referencedBy[name]) -- cgit v1.2.3