summaryrefslogtreecommitdiff
path: root/src/libs/3rdparty
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2016-04-18 11:12:05 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2016-04-18 12:31:37 +0000
commit9a35b121ee4a1eec5ae7e9afb111e541b0b3f146 (patch)
treebdee9abc8cfe7167c8d1780217a5bf7f54843492 /src/libs/3rdparty
parent65046c2003605c57ed67cb5d2dfd1244527c3d75 (diff)
downloadqt-creator-9a35b121ee4a1eec5ae7e9afb111e541b0b3f146.tar.gz
C++: Fix accessing invalid file id of Symbol
Symbol::_fileId can be null if the Symbol was created with a null translation unit. That is the case for temporary symbols created for lookup purposes (CreateBindings has a _control with no translation unit and thus creates symbols with no fileId). Task-number: QTCREATORBUG-15967 Change-Id: Iee518b39ba3b636fe1658e74179db3aad054d6f2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/3rdparty')
-rw-r--r--src/libs/3rdparty/cplusplus/Symbol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp
index ae20b14bb7..e98b33a8a7 100644
--- a/src/libs/3rdparty/cplusplus/Symbol.cpp
+++ b/src/libs/3rdparty/cplusplus/Symbol.cpp
@@ -191,10 +191,10 @@ const StringLiteral *Symbol::fileId() const
}
const char *Symbol::fileName() const
-{ return fileId()->chars(); }
+{ return _fileId ? _fileId->chars() : ""; }
unsigned Symbol::fileNameLength() const
-{ return fileId()->size(); }
+{ return _fileId ? _fileId->size() : 0; }
const Name *Symbol::unqualifiedName() const
{