Actions
Bug #20
closed![Author: Anonymous](https://www.gravatar.com/avatar/2f43b42fd833d1e77420a8dae7419000?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Michael Kay](https://www.gravatar.com/avatar/db6526d63053f09b62e52c2da8b2230a?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
position variable incorrectly removed in ForClause
Start date:
Due date:
% Done:
100%
Estimated time:
Legacy ID:
sf-3464429
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
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
Please register to edit this issue
Actions