[umbrello] [Bug 338649] Extend C++ import for C++11

Oliver Kellogg bugzilla_noreply at kde.org
Sun May 9 16:47:38 BST 2021


--- Comment #22 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
Git commit 7d3eb053739413a0eef8c111e0c9a41843227cf2 by Oliver Kellogg.
Committed on 09/05/2021 at 15:47.
Pushed by okellogg into branch 'release/21.04'.

Fix crash reported in https://bugs.kde.org/show_bug.cgi?id=338649#c20
related to multiple calls of m_source.unicode() where the calls return
different address values.
The solution is to call m_source.unicode() only once:

- In class Lexer add private member m_src of type const QChar*.

- In function Lexer::setSource,
  - assign m_source.unicode() to m_src;
  - if m_source.isEmpty() returns true then return without calling
- In function Lexer::reset initialize m_src to null pointer.
- In function Lexer::offset return m_src + offset.
- In function Lexer::getOffset use m_src in lieu of src.
  This avoids the second call to m_source.unicode() which on newer Qt5
  versions may return a different buffer.

M  +8    -7    lib/cppparser/lexer.cpp
M  +1    -0    lib/cppparser/lexer.h


You are receiving this mail because:
You are the assignee for the bug.

More information about the umbrello-devel mailing list