Project

Profile

Help

Bug #3162

closed

Incorrect captured groups in fn:analyze-string

Added by Michael Kay over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2017-03-13
Due date:
% Done:

100%

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

Description

See https://saxonica.plan.io/boards/3/topics/6720?r=6722

The repro has been added to QT3 as test analyzeString-029.

Actions #1

Updated by Michael Kay over 7 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.7, 9.8 added

I have initially implemented a fairly modest fix, to minimize risk. The change is that OpSequence (which implements a regular expression corresponding to a sequence of subexpressions (a) knows statically whether it contains any capturing subexpressions, and (b) if so, when it starts matching, it takes a copy of the state of the matcher (specifically the current captured groups), and if the sequence as a whole does not match, then it resets the state to the original.

I will experiment with improvements to this solution on the 9.8 branch. For example, I think we can improve the data structure for holding this state information.

Actions #2

Updated by O'Neil Delpratt over 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.18 added

Bug fix applied in the Saxon 9.7.0.18 maintenance release.

Actions #3

Updated by O'Neil Delpratt about 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #4

Updated by O'Neil Delpratt about 7 years ago

  • Applies to branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF