From 7e01d01d8014d8f9079351a471fab286a4a74ea6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 24 Jun 2022 13:09:41 +0200
Subject: [PATCH] VariableNode::writeBytecodeOutput(): check for temporary
 terms, as done for other types of output

---
 src/ExprNode.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ExprNode.cc b/src/ExprNode.cc
index 8216988e..72553686 100644
--- a/src/ExprNode.cc
+++ b/src/ExprNode.cc
@@ -1250,6 +1250,9 @@ VariableNode::writeBytecodeOutput(BytecodeWriter &code_file, bool lhs_rhs,
                                   const temporary_terms_idxs_t &temporary_terms_idxs, bool dynamic, bool steady_dynamic,
                                   const deriv_node_temp_terms_t &tef_terms) const
 {
+  if (checkIfTemporaryTermThenWriteBytecode(code_file, temporary_terms, temporary_terms_idxs, dynamic))
+    return;
+
   auto type = get_type();
   if (type == SymbolType::modelLocalVariable || type == SymbolType::modFileLocalVariable)
     datatree.getLocalVariable(symb_id)->writeBytecodeOutput(code_file, lhs_rhs, temporary_terms, temporary_terms_idxs, dynamic, steady_dynamic, tef_terms);
-- 
GitLab