From a6caf55029a3b14042a8826e14484f1ba5ec74e2 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan.bastani@ens.fr>
Date: Fri, 8 Apr 2011 13:21:19 +0200
Subject: [PATCH] bug fix: nonstationary vars and tex names (cherry picked from
 commit aff56297361d04a07abf5bb1a58202aafd772733)

---
 preprocessor/ParsingDriver.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc
index d539fb0e3a..aff396f0ac 100644
--- a/preprocessor/ParsingDriver.cc
+++ b/preprocessor/ParsingDriver.cc
@@ -304,7 +304,10 @@ ParsingDriver::add_expression_variable(string *name)
 void
 ParsingDriver::declare_nonstationary_var(string *name, string *tex_name)
 {
-  declare_endogenous(new string(*name), tex_name);
+  if (tex_name != NULL)
+    declare_endogenous(new string(*name), new string(*tex_name));
+  else
+    declare_endogenous(new string(*name), tex_name);
   declared_nonstationary_vars.push_back(mod_file->symbol_table.getID(*name));
   mod_file->nonstationary_variables = true;
   delete name;
-- 
GitLab