summaryrefslogtreecommitdiffstats
path: root/languages/cpp/cppsupportpart.cpp
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:29:10 +0800
commit8db222314776de8aa490cee00f08715c02dbd4b8 (patch)
treecd4ff1a31efeb916156ab2b17ddb3755b884b122 /languages/cpp/cppsupportpart.cpp
parent99540590bedba8e595f1aa60a7cbd6634ad1f420 (diff)
downloadtdevelop-8db222314776de8aa490cee00f08715c02dbd4b8.tar.gz
tdevelop-8db222314776de8aa490cee00f08715c02dbd4b8.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>
Diffstat (limited to 'languages/cpp/cppsupportpart.cpp')
-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 32be7a45..e444bfea 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;