Project

Profile

Help

Bug #4642

closed

-TP option fails with XQuery

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

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

100%

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

Description

Actions #1

Updated by Michael Kay almost 4 years ago

It's failed at line 16 executing (1 to $number-of-cols) ! <col>{$col-value}</col>

Because the expression (1 to $number-of-cols) occurs in a loop and is invariant over the loop, it's been bound to a system-allocated local variable, but no slot for this variable has been allocated on the stack.

Actions #2

Updated by Michael Kay almost 4 years ago

It's evaluating variable $m1 (the function call to local:make-rows() has been inlined. The variable (internally, a GlobalParam has a null stackframeMap.

Allocation of slots to local variables happens in GlobalVariable.typeCheck(), called from Executable.typeCheckGlobalVariables(). At this the function call has already been inlined, but loop-lifting has not yet taken place, so there are no local variables.

The problem appears to be that the ComponentTracer expression (injected by virtue of the -TP option) is not doing a deep copy during function inlining -- only a shallow copy -- which means that after inlining, a subtree is shared between the original function and the inlined copy, which invalidates slot number allocation.

Actions #3

Updated by Michael Kay almost 4 years ago

  • Category set to Diagnostics
  • Status changed from New to Resolved
  • Priority changed from Low to Normal
  • Applies to branch 10, trunk added
  • Fix Committed on Branch 10, trunk added
Actions #4

Updated by O'Neil Delpratt over 3 years ago

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

Bug fix applied in the Saxon 10.2 maintenance release.

Actions #5

Updated by O'Neil Delpratt over 3 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF