Robin,
how do you generate the bugs, for God's sake? Are you running all the
possible ASCII sequences as stylesheets? Anyway, here's a patch fixing
all of the 3 problems you mention. It's sort of hand-made (the working
copy has many more changes which I deleted by hand) hence the fuzzy
match.
Big thanks for the testing.
Tom
diff -Naur old\expr.cpp new\expr.cpp
--- old\expr.cpp Fri Jun 02 13:39:34 2000
+++ new\expr.cpp Tue Jun 27 17:03:22 2000
@@ -779,7 +775,11 @@
Bool LocStep::matches(Vertex *v)
{
- assert(v);
+ // removed the following:
+ // assert(v);
+ // (because the parent-of-root calls etc.)
+ if (!v)
+ return FALSE;
VTYPE ty = (VTYPE) ((v -> vt) & VT_BASE);
switch(ntype)
{
@@ -2862,8 +2855,8 @@
};
if (hasPath)
{
- // -1 stands for the union of contexts over all bases in newc:
- E( args[i] -> createLPContextSum(0, filteredc = newc) );
+ // removed: E( args[i] -> createLPContextSum(0, filteredc = newc) );
+ E( args[argsNumber-1] -> createLPContextSum(0, filteredc = newc) );
delete newc;
newc = filteredc;
}
diff -Naur old\verts.cpp new\verts.cpp
--- old\verts.cpp Fri Jun 02 13:39:34 2000
+++ new\verts.cpp Tue Jun 27 17:16:54 2000
@@ -1012,6 +1089,7 @@
eFlag XSLElement::execute(Context *c)
{
Attribute *a;
+ Bool didNotExecute = FALSE;
// ???
if (c -> isFinished())
return OK;
@@ -1074,7 +1152,9 @@
Bool boolval = boolexpr.tobool();
if ((boolval) && (contents.number()))
// E( proc -> execute(contents[0],c) );
- E( contents.execute(c) );
+ E( contents.execute(c) )
+ else
+ didNotExecute = TRUE;
}; break;
case XSL_CHOOSE:
{
@@ -1350,9 +1413,10 @@
default:
Err(ET_UNSUPP_XSL);
};
//remove the variable bindings that occured inside this element
- if ((op != XSL_TEMPLATE) && (op != XSL_TRANSFORM) && (op != XSL_STYLESHEET))
+ if ((op != XSL_TEMPLATE) && (op != XSL_TRANSFORM) && (op != XSL_STYLESHEET) &&
+ !didNotExecute)
removeBindings();
situation.popCurrent();
return OK;