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
Actions #1

Updated by Anonymous over 12 years ago

SourceForge user: mhkay

Fixed in 9.4.0.2

Actions #2

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.

Actions #3

Updated by Michael Kay almost 12 years ago

  • Status changed from New to Resolved
  • Assignee set to Michael Kay
Actions #4

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

Also available in: Atom PDF