forked from qt-creator/qt-creator
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>
This commit is contained in:
4
src/libs/3rdparty/cplusplus/Symbol.cpp
vendored
4
src/libs/3rdparty/cplusplus/Symbol.cpp
vendored
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user