summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-11-28 15:29:10 +0800
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-11-28 15:33:30 +0800
commitf6002795d6ed8121466712452dc681963cefa997 (patch)
treed637a00373fe310da3dfef80a0dcc2a13715ac5c
parent036a3ec29317ed1372111269e736378c0ac8217a (diff)
downloadtdevelop-f6002795d6ed8121466712452dc681963cefa997.tar.gz
tdevelop-f6002795d6ed8121466712452dc681963cefa997.zip
Fixed SEGV caused by dereferencing NULL pointer when right clicking
inside files not supported. This relates to bug 3173. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 8db222314776de8aa490cee00f08715c02dbd4b8)
-rw-r--r--languages/cpp/cppsupportpart.cpp7
1 files changed, 6 insertions, 1 deletions
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;