Project

Profile

Help

Bug #1751

closed

Wrong location information when debugging

Added by Alex Jitianu over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Low
Category:
Internals
Sprint/Milestone:
-
Start date:
2013-04-29
Due date:
% Done:

100%

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

Description

I have run a transformation over the attached sample files with trace information:


As you can see in the log, the location information starting with variable *v* is wrong (for example variable *v* is located on line *4*):
<pre>
<trace saxon-version="9.5.0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <source node="/" line="0" file="deb.xml">
  <xsl:template match="/" line="2" module="deb.xsl">
   <xsl:variable name="a" line="3" module="deb.xsl">
    <xsl:variable name="v" line="3" module="deb.xsl">
     <xsl:choose line="4" module="deb.xsl">

The problem appears to be related to variable a which is unused. Also, if you disable the optimizations the line information is correct:

java -cp saxon9ee.jar;saxon-license.lic net.sf.saxon.Transform -s:deb.xml -xsl:deb.xsl -T -opt:0

Correct output:

<trace saxon-version="9.5.0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <source node="/" line="0" file="deb.xml">
  <xsl:template match="/" line="2" module="deb.xsl">
   <xsl:variable name="a" line="3" module="deb.xsl">
    <xsl:variable name="v" line="4" module="deb.xsl">
     <xsl:choose line="5" module="deb.xsl">

Files

deb.xsl (474 Bytes) deb.xsl Alex Jitianu, 2013-04-29 14:42
deb.xml (221 Bytes) deb.xml Alex Jitianu, 2013-04-29 14:42
Actions #1

Updated by O'Neil Delpratt over 11 years ago

  • Category set to Internals
  • Status changed from New to Resolved
  • Assignee set to O'Neil Delpratt
  • % Done changed from 0 to 100

Thanks for reporting the issue to found. It is indeed a bug which we have managed to resolve and commit to subversion.

During the optimization the rewritten expressions were over-writing the location information unnecessarily when it should maintain it, when it is known. Fix applied in the ExpressionTool class.

Actions #2

Updated by Michael Kay over 11 years ago

The patch had a side-effect which I am correcting; it meant that the "Container" information for nodes in the expression tree could be null, leading to a NullPointerException.

Actions #3

Updated by O'Neil Delpratt over 11 years ago

  • Status changed from Resolved to Closed
  • Found in version changed from 9.5.0.1 to 9.5
  • Fixed in version set to 9.5.0.2

Please register to edit this issue

Also available in: Atom PDF