Project

Profile

Help

Bug #1811

closed

Local variable used in a pattern

Added by Michael Kay almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2013-06-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

The error

* Internal Saxon error: local variable encountered whose binding has been deleted

occurs when a local variable is used in a pattern (e.g. a count pattern in xsl:number) and this is the only reference to that variable. For example

<xsl:variable name="href" select="..." as="xs:string"/>

<xsl:number select="$prmTopicRef"

level="any"

count="*[string(@href)=$href]"

from="*[contains(@class,' map/map ')]"

format="1"/>

Reported today by Toshihiko Makita on saxon-help mailing list

Actions #1

Updated by Michael Kay almost 11 years ago

There are actually two bugs.

(a) the reference to the variable is not identified as a "looping reference", which means that the compiler attempts to inline the variable. It should not do this, because the value of the variable (as it appears in a predicate) is used repeatedly

(b) the inlining of the variable is not correctly implemented for a variable reference within a pattern; the declaration of the variable is removed from the expression tree, but the reference to the variable remains.

Patches for both problems are being committed to the 9.5 (and 9.6) branches.

Actions #2

Updated by Michael Kay almost 11 years ago

  • Status changed from New to Resolved
Actions #3

Updated by O'Neil Delpratt almost 11 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.5.1.1

Bug now closed. Applied to the Saxon 9.5.1.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF