Project

Profile

Help

Bug #1811

Local variable used in a pattern

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

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

100%

Spent time:
-
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
9.5
Fixed in version:
9.5.1.1

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

History

#1 Updated by Michael Kay almost 3 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.

#2 Updated by Michael Kay almost 3 years ago

  • Status changed from New to Resolved

#3 Updated by O'Neil Delpratt almost 3 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.

Also available in: Atom PDF