XalanC
  1. XalanC
  2. XALANC-625

Spurious (though harmless) assert failure in XPath::findNodeSet() when an expression contains an empty node-set enclosed in parenthesis

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10
    • Fix Version/s: CurrentCVS
    • Component/s: XPathC
    • Labels:
      None
    • Environment:
      winxpsp2

      Description

      There is a spurious (though apparently harmless) assert failure in XPath::findNodeSet() when compiled in Debug mode
      if an expression contains an empty node-set enclosed in parenthesis, as in the following stylesheet:

      <?xml version="1.0" encoding = "ISO-8859-1"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
      <xsl:variable name="empty-nodeset" select="/.."/>
      <xsl:variable name="foo" select="($empty-nodeset)/@bar"/>
      <xsl:value-of select="count($foo)"/>
      </xsl:template>
      </xsl:stylesheet>

      Best regards,
      Alain Le Guennec.

      1. patch.diff
        2 kB
        David Bertoni
      2. nonemptynodeset.xsl
        0.3 kB
        David Bertoni
      3. nonemptynodeset.xml
        0.0 kB
        David Bertoni
      4. assertemptynodeset.xslt
        0.3 kB
        Alain Le Guennec

        Activity

        Alain Le Guennec created issue -
        Hide
        Alain Le Guennec added a comment -

        The stylesheet.

        Show
        Alain Le Guennec added a comment - The stylesheet.
        Alain Le Guennec made changes -
        Field Original Value New Value
        Attachment assertemptynodeset.xslt [ 12340126 ]
        Hide
        David Bertoni added a comment -

        This assert actually uncovered what is a more serious error. In cases where executeMore() returns a non-null XObjectPtr, that value should be used, but the code in group() is actually ignoring it.

        I'm attaching a stylesheet and source document that not only trip the assert, but also return an incorrect result.

        A patch will follow.

        Show
        David Bertoni added a comment - This assert actually uncovered what is a more serious error. In cases where executeMore() returns a non-null XObjectPtr, that value should be used, but the code in group() is actually ignoring it. I'm attaching a stylesheet and source document that not only trip the assert, but also return an incorrect result. A patch will follow.
        David Bertoni made changes -
        Attachment nonemptynodeset.xsl [ 12346485 ]
        David Bertoni made changes -
        Attachment nonemptynodeset.xml [ 12346486 ]
        David Bertoni made changes -
        Attachment nonemptynodeset.xsl [ 12346485 ]
        David Bertoni made changes -
        Attachment nonemptynodeset.xsl [ 12346488 ]
        Hide
        David Bertoni added a comment -

        A patch is attached. Committers, can you please review?

        Show
        David Bertoni added a comment - A patch is attached. Committers, can you please review?
        David Bertoni made changes -
        Attachment patch.diff [ 12346496 ]
        David Bertoni made changes -
        Assignee David Bertoni [ dbertoni ]
        Hide
        Dmitry Hayes added a comment -

        The patch looks ok . Let's commit it . Thanks!

        Show
        Dmitry Hayes added a comment - The patch looks ok . Let's commit it . Thanks!
        Hide
        David Bertoni added a comment -

        Patch committed.

        Show
        David Bertoni added a comment - Patch committed.
        David Bertoni made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s CurrentCVS [ 10833 ]
        Mark Thomas made changes -
        Workflow jira [ 12382946 ] Default workflow, editable Closed status [ 12572349 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12572349 ] jira [ 12592597 ]

          People

          • Assignee:
            David Bertoni
            Reporter:
            Alain Le Guennec
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development