Bug #3444
closedIllegalStateException: local variable whose binding has been deleted, after eliminating common subexpressions in a pattern predicate
100%
Description
Branched from issue #3443:
I now tried running with -TP:profile.html and got an exception:
java.lang.IllegalStateException: *** Internal Saxon error: local variable encountered whose binding has been deleted
The problem seems to be with the group-starting-with pattern in
<xsl:for-each-group select="$versionsXML/*"
group-starting-with="*[not(preceding-sibling::*[1]/@digest =
@digest and int:nextDay(preceding-sibling::*[1]/@validToDate) = @validFromDate)]">
at sharedFunctions.xsl#251
(Note this is a compile-time problem; it typically arises because the extra code injected into the expression tree to support run-time profiling makes the optimizer's job more difficult).
Updated by Michael Kay over 6 years ago
Both BasePatternWithPredicate and BooleanExpressionPattern have the predicate as a local variable in the Expression instance, rather than fetching it via an Operand object. This means that when the optimizer rewrites the predicate, for example by introducing a local variable during common subexpression elimination, the parent expression/pattern still points to the old value - which means that the newly created LetExpression is not actually present on the tree.
Updated by Michael Kay over 6 years ago
- Status changed from New to Resolved
- Fix Committed on Branch 9.8 added
Fixed both the affected Pattern classes to use Operand objects properly.
Also changed the CommonSubexpressionPromoter to reset cached properties on the affected subtree, ensuring that all nodes recalculate their properties next time they are needed (there may be new or dropped dependencies on local variables).
Updated by O'Neil Delpratt over 6 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.8.0.5 added
Bug fix applied in the Saxon 9.8.0.5 maintenance release.
Please register to edit this issue