Subject: mailing-list for TeXmacs Users
List archive
From : Enrique Perez-Terron <address@hidden>- To: address@hidden
- Subject: [TeXmacs] Another code error
- Date: Tue, 07 Oct 2008 01:48:54 +0200
Version 1.0.6.15.
In file evaluate_macro.cpp, line 229:
tree
expand (tree t, assoc_environment env) {
if (is_atomic (t)) return t;
else {
int i, n= N(t);
switch (L(t)) {
case MACRO:
{
assoc_environment local= copy (env);
for (i=0; i+1<n; i+=2)
if (is_atomic (t[i])) {
int key= make_tree_label (t[i]->label);
local->remove (key);
}
bool flag= true;
tree r (t, n);
for (i=0; i<n; i++) {
r[i]= expand (t[i], i==n-1? local: env);
flag= flag && weak_equal (r[i], t[i]);
}
if (flag) return t;
return r;
}
case XMACRO:
{
assoc_environment local= copy (env);
if (is_atomic (t[i])) {
-------------------------^
int key= make_tree_label (t[0]->label);
local->remove (key);
}
tree body= expand (t[1], local);
if (weak_equal (body, t[1])) return t;
return tree (XMACRO, t[0], body);
}
The variable 'i' has not been initialized. The constant zero should be
used instead, as in the next line.
Regards
Enrique
- [TeXmacs] Another code error, Enrique Perez-Terron, 10/07/2008
Archive powered by MHonArc 2.6.19.