Project

Profile

Help

Bug #4534

NullPointerException with invalidly-initialized global variable

Added by Michael Kay about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2020-04-30
Due date:
% Done:

100%

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

Description

This typo (note the spurious “)” inside the putative QName):

 <xsl:variable name="dbe:INVALID-INJECT"
               select="xs:QName('dbe:INVALID-INJECT)')"/>

Causes an NPE in Saxon EE 10.0:

java.lang.NullPointerException
	at net.sf.saxon.expr.Expression.getRetainedStaticContext(Expression.java:462)
	at net.sf.saxon.expr.parser.LoopLifter.process(LoopLifter.java:50)
	at net.sf.saxon.expr.parser.ExpressionTool.optimizeComponentBody(ExpressionTool.java:1075)
	at net.sf.saxon.style.XSLGlobalVariable.optimize(XSLGlobalVariable.java:370)

Saxon spots the invalid QName at compile time and generates an ErrorExpression, but fails to assign it a RetainedStaticContext, causing the NPE when loop-lifting optimization later visits the expression.

History

#1 Updated by Michael Kay about 1 year ago

  • Status changed from New to Resolved
  • Applies to branch 10, 9.9 added
  • Fix Committed on Branch 10, 9.9 added

Patched in StyleElement.typeCheck().

#2 Updated by O'Neil Delpratt about 1 year ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.1 added

Bug fix committed in the Saxon 10.1 maintenance release.

#3 Updated by O'Neil Delpratt 8 months ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 10.2, 9.9.1.8 added
  • Fixed in Maintenance Release deleted (10.1)

Bug fix applied on the Saxon 9.9.1.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF