Bug #20
closedposition variable incorrectly removed in ForClause
100%
Description
SourceForge user: ond1
A fix has been applied to the class ForClause. We check that all terms in a WhereClause is not depending on the position variables in a ForClause before removing the variable; This fixes the following bug reported by Gunther Rademacher:
An exception as stated in the subject line was thrown while
running some pre-existing XQuery code on Saxon-HE 9.4.0.1J and on Saxon-EE 9.4.0.1J.
The shortest repro that I (Gunther Rademacher) could come up with is this:
declare function local:f($a, $b) as node()*
{
let $c := $a[1]
return
if (empty($a)) then
$b
else if ($c/self::y) then
for $e at $i in $c/*
where $i > 1 and $i < count($c/*)
return $e
else
local:f($a[position() > 1], ($b, $c))
};
local:f(<x/>, ())
While reducing the original code, at one point I also saw a
java.lang.ArrayIndexOutOfBoundsException:
Local variable has not been allocated a stack frame slot
Updated by Anonymous about 12 years ago
SourceForge user: mhkay
Reopened: the previous fix (incorporated in 9.4.0.2) was incomplete. Before replacing a test on the positional variable in a where clause by a positional predicate, we need to check that there are no other references to the positional variable anywhere in the FLWOR expression. The previous fix was only checking for other references elsewhere in the where clause. A revised fix is being committed.
Updated by Michael Kay almost 12 years ago
- Status changed from New to Resolved
- Assignee set to Michael Kay
Updated by Michael Kay almost 12 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
Please register to edit this issue