Project

Profile

Help

Bug #5626

closed

Incorrect inference regarding static context item type in xsl:evaluate

Added by Michael Kay over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2022-07-29
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

The static type checking for the expression evaluated using xsl:evaluate assumes that the context item type will be the same as the context item type for the xsl:evaluate instruction itself.

I haven't found any adverse consequences on the 11.x branch, but it's causing a crash on 12.x because we aren't checking for the context item being absent in test evaluate-024.

Actions #1

Updated by Michael Kay over 2 years ago

  • Category set to Internals
  • Status changed from New to Resolved
  • Applies to branch 11, trunk added
  • Fix Committed on Branch 11, trunk added
  • Platforms .NET, Java added

I haven't been able to devise a test case that demonstrates the problem in Saxon 11.

The only thing we are getting wrong is the inference of whether the context item may or may not be absent, and I think we only use that knowledge when we are generating bytecode (it means we can avoid generating a run-time check for the condition). But we never generate bytecode for the expression evaluated using xsl:evaluate, so the fact that our inference is wrong has no impact.

Nevertheless, I will apply the correction.

For the 12.x branch I've changed the xsl:evaluate code to set the inferred context item static type more precisely, by looking at what can be inferred from the supplied context-item expression.

Actions #2

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 12.0 added

Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied on the Saxon 11 branch.

Actions #3

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 11.5 added

Bug applied in the Saxon 11.5 Maintenance release.

Actions #4

Updated by O'Neil Delpratt almost 2 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF