Alon Rosenfeld 18 Hatzedef street Jaffa (alon++at++bvr.co.il)
Thu, 30 Jun 1994 18:48:41 +0000
I believe that there is a bug in the pfuTraverse() routine.
The bug is such that every time the routine recursively enters itself, it
writes the node (given as a parameter) into trav->node. The fact that trav is a
pointer to a single copy of the trav structure (initially passed by the user)
causes the last assignment of trav->node to hold and in turn the postFunc will
get a trav pointer with a wrong node pointer (that of the last visited node in
the recursion).
I fixed it as follows:
pfuTraverse(pfNode *node, pfuTraverser *trav)
{
pfMatrix mat;
.
.
pfNode *keep_node;
keep_node = trav->node;
trav->node = (pfNode *)node;
.
.
.
.
.
if (trav->postFunc)
(*trav->postFunc)(trav);
trav -> node = keep_node;
return PFTRAV_CONT;
}
Thats it I guess
Alon
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:22 PDT