Project

Profile

Help

Bug #1600

closed

Incorrect optimization of global variables in XSLT

Added by Michael Kay over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2012-08-03
Due date:
% Done:

100%

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

Description

A problem has been found with optimization of global variables in XSLT. The symptom might be a NullPointerException, or perhaps

java.lang.ArrayIndexOutOfBoundsException: Local variable has not been allocated a stack frame slot

The only external factor that is characteristic of the problem is that the initializer of the global variable contains a filter expression or other looping construct.

Internally, the problem occurs when there is more than one phase of optimization that improves the initialization expression, and where the first such phase creates a new expression that binds local variables. The code that allocates a stackframe for computing the global variable decides on the basis of the old (unoptimized) expression that no stackframe slots are needed.

A patch has been developed and tested for the 9.4 branch. The relevant code for the development branch has been refactored; the problem is present but a fix has not yet been identified. Test case attached.


Files

source.xml (260 Bytes) source.xml Michael Kay, 2012-08-03 14:08
style.xsl (1.11 KB) style.xsl Michael Kay, 2012-08-03 14:08

Please register to edit this issue

Also available in: Atom PDF