Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21411

Crash after infinite recursion between highlight rules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • Qt Creator 4.7.0, Qt Creator 4.8.0-beta2
    • Editors
    • None

    Description

      Malformed highlight definitions might have a case (trivial example, actual definition might look more complex.):

       

      <context name="foo" fallthroughContext="bar">
      <context name="bar" fallthroughContext="#pop">

      The context stack (m_currentContexts) alternating between foo and bar, but context evaluation is processed through recursion, i.e. iterateThroughRules() calls itself:

      if (m_currentContext->isFallthrough()) {
          iterateThroughRules(text, length, progress, false, m_currentContext->rules()); 
      

      This leads to infinite recursion call. Some safety measures should be implemented, like Kate does.

      Implementation should detect recursion call and stop processing current line. I.e. when iterateThroughRules() was already called with exactly same context stack and progress->offset().

       

      Attachments

        1. crash.qtccrsh
          0.0 kB
        2. qtccrsh.xml
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            dendy Daniel Levin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes