Endless state transition guard
ClosedPublic

Authored by cullmann on Sep 29 2018, 3:37 PM.

Details

Summary

This e.g. catches the "hang" people did see before the fix in https://phabricator.kde.org/D15773
Its a simple good old "endless loop counter" that aborts after too many transitions.
IMHO more than a few without any progress at the text offset make no sense, therefore the hard limit of 1024 should be reasonable

Test Plan

I tried the examples attached for https://phabricator.kde.org/D15773, with my fix, I get just

Endless state transitions, aborting highlighting of line.

as debug output but no longer any hang.

(but yes, the highlighting of some lines is messed up, which IMHO is ok, much better than a hard hang of the application

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Lint Skipped
Unit
Unit Tests Skipped
cullmann created this revision.Sep 29 2018, 3:37 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptSep 29 2018, 3:37 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
cullmann requested review of this revision.Sep 29 2018, 3:37 PM
vkrause accepted this revision.Sep 29 2018, 3:39 PM
This revision is now accepted and ready to land.Sep 29 2018, 3:39 PM
This revision was automatically updated to reflect the committed changes.