From aaef2696e42d705bd9712ec1212127a15e38488a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Fri, 11 Jun 2010 19:21:03 +0200
Subject: [PATCH] Preprocessor: fixed bug (substitution was incorrectly done
 with leads on exogenous) (cherry picked from commit
 c4ef68b2939757169eea465f95c4937d04047513)

---
 preprocessor/ExprNode.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/preprocessor/ExprNode.cc b/preprocessor/ExprNode.cc
index 67a38ebcc1..ee47e18514 100644
--- a/preprocessor/ExprNode.cc
+++ b/preprocessor/ExprNode.cc
@@ -2694,7 +2694,7 @@ BinaryOpNode::substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vecto
       return buildSimilarBinaryOpNode(arg1subst, arg2subst, datatree);
     case oTimes:
     case oDivide:
-      if (maxendolead1 >= 2 && maxendolead2 == 0 && arg2->maxExoLead())
+      if (maxendolead1 >= 2 && maxendolead2 == 0 && arg2->maxExoLead() == 0)
         {
           arg1subst = arg1->substituteEndoLeadGreaterThanTwo(subst_table, neweqs);
           return buildSimilarBinaryOpNode(arg1subst, arg2, datatree);
@@ -2738,7 +2738,7 @@ BinaryOpNode::substituteExoLead(subst_table_t &subst_table, vector<BinaryOpNode
       return buildSimilarBinaryOpNode(arg1subst, arg2subst, datatree);
     case oTimes:
     case oDivide:
-      if (maxexolead1 >= 1 && maxexolead2 == 0 && arg2->maxEndoLead())
+      if (maxexolead1 >= 1 && maxexolead2 == 0 && arg2->maxEndoLead() == 0)
         {
           arg1subst = arg1->substituteExoLead(subst_table, neweqs);
           return buildSimilarBinaryOpNode(arg1subst, arg2, datatree);
-- 
GitLab