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

Oliver Kellogg bugzilla_noreply at kde.org
Thu May 13 17:50:23 BST 2021


--- Comment #23 from Oliver Kellogg <okellogg at users.sourceforge.net> ---
Git commit 3041141b10361aedb3c8c06c9ba36b5d25ac6f9a by Oliver Kellogg.
Committed on 13/05/2021 at 16:49.
Pushed by okellogg into branch 'release/21.04'.

lib/cppparser/lexer.{h,cpp} followup to commit 7d3eb05,
> Fix crash [...] 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: [...]

As detailed by jeremy_k at https://forum.qt.io/post/659243,
the above change does not remove the root cause:
- m_ptr is initially set to m_source.unicode()
- During the import, m_source is modified (e.g. by calls to function
- These modifications invalidate the unicode buffer which is pointed to
  by m_ptr / m_endPtr.
Generally I do not see a significant advantage in using the unicode
buffer in this context.

Changes in class Lexer:
- Remove public functions
  - const CHARTYPE* offset(int offset) const;
  - int getOffset(const QChar* p) const.
- Remove private function
  void setEndPtr(const QChar* c).
- Remove private members m_src, m_ptr, m_endPtr of type `const QChar*`.
- Add private members m_idx, m_endIdx of type int.
  These are used as indexes into m_source.

M  +26   -56   lib/cppparser/lexer.cpp
M  +2    -14   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