aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-12 07:15:47 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-12 07:15:47 +0000
commitcb7b1e17b63967317ab5cc55682168cf0380519a (patch)
treeae64d4fe18e56974c3aae2c99e86aa954410ccdb /include/clang/Basic/SourceManager.h
parent8f0889ce457db51d3af1eb1245bceee272d4dc7d (diff)
Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 4f5c17344d..d5e41de25f 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -724,6 +724,11 @@ public:
///
/// Note that a presumed location is always given as the instantiation point
/// of an instantiation location, not at the spelling location.
+ ///
+ /// \returns The presumed location of the specified SourceLocation. If the
+ /// presumed location cannot be calculate (e.g., because \p Loc is invalid
+ /// or the file containing \p Loc has changed on disk), returns an invalid
+ /// presumed location.
PresumedLoc getPresumedLoc(SourceLocation Loc) const;
/// isFromSameFile - Returns true if both SourceLocations correspond to