D18982: prevent assertion in regex load

Dominik Haumann noreply at phabricator.kde.org
Wed Feb 13 15:24:06 GMT 2019


dhaumann added a comment.


  I think that makes a lot of sense. Maybe we should even always print the warning, not only in debug mode? See comment below...
  
  PS: When submitting patches without phabricator's arc tool, could you add more diff context, like `git diff -U99 ...`. Then reviewing is much more simple.

INLINE COMMENTS

> rule.cpp:579-582
> +    if (Log().isDebugEnabled()) {
> +        if (!m_regexp.isValid())
> +            qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern();
> +    }

I even wonder whether this should be always printed, i.e.:

  const bool isValid = m_regexp.isValid();
  if (!isValid)
      qCWarning(...) << "Invalid regexp:" << m_regexp.pattern();
  }
  return isValid && !m_regexp.pattern().isEmpty();

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18982

To: davschul, vkrause
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, bruns, demsking, cullmann, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190213/b5279d8f/attachment-0001.html>


More information about the KWrite-Devel mailing list