Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 81796d50215e7c83cd09d6de47fae143b818bff327019e01aca1cdddffdacfd6
Ticket: 75c9d9cece5612408603f4e56773f55ada24b2d7
regexp sometimes allows an invalid backref to be matched
User & Date: tgl on 2021-08-23 16:04:19
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    $ tclsh
    % regexp {^(.)\1|\1.}   {abcdef}
    1
    % regexp {^((.)\2|..)\2}        {abadef}
    1
    
    Of course, neither of these should match, because the (.) capture is within a failed alternative branch,
    so the last backref to it should be deemed unable to match.
    
    Analysis and fix for it in Postgres is here:
    
    https://www.postgresql.org/message-id/151435.1629733387%40sss.pgh.pa.us
    
    I doubt you can use the code change exactly as-is, because I don't think you ever adopted our changes
    to create an explicit "iteration" subre type.  But the principle, and particularly the more careful
    specification of cdissect's recursion rules, should still work for you.
    
  5. foundin changed to: "8.6.8"
  6. is_private changed to: "0"
  7. login: "tgl"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "26864b65f1c6ce8bda86f87ed9c554e19ac0390d"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "tgl"
  14. subsystem changed to: "43. Regexp"
  15. title changed to:
    regexp sometimes allows an invalid backref to be matched
    
  16. type changed to: "Bug"