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

"Oliver Kellogg" <[email protected]>
Newsgroups gmane.linux.umbrello.devel
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=338649

--- Comment #23 from Oliver Kellogg <[email protected]> ---
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
  insertCurrent).
- 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

https://invent.kde.org/sdk/umbrello/commit/3041141b10361aedb3c8c06c9ba36b5d25ac6f9a

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.