#198 Incorrect FLWR optimization

v7.9
closed
5
2012-10-08
2004-03-17
Michael Kay
No

When a FLWOR expression contains a clause such as let
$x := $y, then Saxon attempts to "optimize out" the
variable $x, replacing references to $x with references
to $y (the reason for this is mainly to simlify
expressions that the optimizer itself has constructed).
This is done incorrectly if there is a where clause or
a conditional expression as the action part of the let
clause.

Fix: in IfExpression, lines 92-93, change

            thenExp.promote(offer);
            elseExp.promote(offer);

to

            thenExp = thenExp.promote(offer);
            elseExp = elseExp.promote(offer);

The bug is present in previous releases.

Test case added, qxmp124.xq

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks