aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/optimiser/Rematerialiser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libjulia/optimiser/Rematerialiser.cpp')
-rw-r--r--libjulia/optimiser/Rematerialiser.cpp4
1 files changed, 4 insertions, 0 deletions
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<string> 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])