Project

Profile

Help

Bug #20

closed

position variable incorrectly removed in ForClause

Added by Anonymous over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XQuery conformance
Sprint/Milestone:
-
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

Also available in: Atom PDF