From f6002795d6ed8121466712452dc681963cefa997 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 28 Nov 2020 15:29:10 +0800 Subject: Fixed SEGV caused by dereferencing NULL pointer when right clicking inside files not supported. This relates to bug 3173. Signed-off-by: Michele Calgaro (cherry picked from commit 8db222314776de8aa490cee00f08715c02dbd4b8) --- languages/cpp/cppsupportpart.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/languages/cpp/cppsupportpart.cpp b/languages/cpp/cppsupportpart.cpp index 3ff44a35..f8c05c73 100644 --- a/languages/cpp/cppsupportpart.cpp +++ b/languages/cpp/cppsupportpart.cpp @@ -1734,7 +1734,12 @@ void CppSupportPart::MakeMemberHelper( TQString& text, int& atLine, int& atColum TQString implFile = findSourceFile(); m_backgroundParser->lock(); - TranslationUnitAST* translationUnit = *m_backgroundParser->translationUnit( m_activeFileName ); + ParsedFilePointer pTranslationUnit = m_backgroundParser->translationUnit( m_activeFileName ); + TranslationUnitAST *translationUnit = NULL; + if (pTranslationUnit) + { + translationUnit = *pTranslationUnit; + } if ( translationUnit ) { bool fail = false; -- cgit v1.2.3