diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-02-24 17:46:22 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-11 11:54:25 +0100 |
commit | 571a63d5591aa6a9bbf7cdc1fc7c8d2824411d2d (patch) | |
tree | d5753790c3c3900a959ea99f3e0aab8a8266fd2d /compilerplugins | |
parent | 990163534cb5bc63ac500d5204f4caeab056bdf3 (diff) |
avoid a possible crash in loplugin's ignoreLocation()
For the built-in(?) __int128_t there's apparently no valid presumed location.
Change-Id: I1b2f1a827bc914d2f288dd1e02718bf45a50dd1e
Reviewed-on: https://gerrit.libreoffice.org/68870
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 5a31368bdee0..540e58dcd222 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -204,7 +204,10 @@ bool PluginHandler::checkIgnoreLocation(SourceLocation loc) SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc ); if( compiler.getSourceManager().isInSystemHeader( expansionLoc )) return true; - const char* bufferName = compiler.getSourceManager().getPresumedLoc( expansionLoc ).getFilename(); + PresumedLoc presumedLoc = compiler.getSourceManager().getPresumedLoc( expansionLoc ); + if( presumedLoc.isInvalid()) + return true; + const char* bufferName = presumedLoc.getFilename(); if (bufferName == NULL || hasPathnamePrefix(bufferName, SRCDIR "/external/") || isSamePathname(bufferName, SRCDIR "/sdext/source/pdfimport/wrapper/keyword_list") ) |