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

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              allan.jensen Allan Sandfeld Jensen
              Reporter:
              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