diff --git a/preprocessor/ExprNode.cc b/preprocessor/ExprNode.cc index b72f4e0e5..3897415d3 100644 --- a/preprocessor/ExprNode.cc +++ b/preprocessor/ExprNode.cc @@ -596,7 +596,9 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, output << ")"; } else - output << datatree.symbol_table.getName(symb_id); + /* We append underscores to avoid name clashes with "g1" or "oo_" (see + also ModelTree::writeModelLocalVariables) */ + output << datatree.symbol_table.getName(symb_id) << "__"; break; case eModFileLocalVariable: diff --git a/preprocessor/ModelTree.cc b/preprocessor/ModelTree.cc index 495860453..b6e5fb153 100644 --- a/preprocessor/ModelTree.cc +++ b/preprocessor/ModelTree.cc @@ -1171,7 +1171,9 @@ ModelTree::writeModelLocalVariables(ostream &output, ExprNodeOutputType output_t if (IS_C(output_type)) output << "double "; - output << symbol_table.getName(id) << " = "; + /* We append underscores to avoid name clashes with "g1" or "oo_" (see + also VariableNode::writeOutput) */ + output << symbol_table.getName(id) << "__ = "; // Use an empty set for the temporary terms value->writeOutput(output, output_type); output << ";" << endl;