Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
Qt Creator 4.7.0, Qt Creator 4.8.0-beta2
-
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
For Gerrit Dashboard: QTCREATORBUG-21411 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
244225,5 | Fix infinite recursion in highlight processor | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
244777,1 | Fix infinite recursion in highlight processor | 4.6 | qt-creator/qt-creator | Status: ABANDONED | -1 | 0 |