Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62175

Regexp.lastIndex sometimes leak between separate instances

    XMLWordPrintable

Details

    Description

      In the work to port kate to QmlScript I encountered another RegExp bug in QML. I unfortunately haven't been able to write a reduced test-case yet, but what happened was that lastIndex on a global RegExp started not null, if the same RegExp literal had been matched before, even though the new match was started from a new literal.

      I am assuming there is a cache of compiled RegExps somewhere, and we probably are lacking a reset of lastIndex when a new RegExp gets a cached value instead of a new C++ object.

      Attachments

        1. test.cpp
          2 kB
          Allan Sandfeld Jensen

        Issue Links

          For Gerrit Dashboard: QTBUG-62175
          # Subject Branch Project Status CR V

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              allan.jensen Allan Sandfeld Jensen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes