diff options
Diffstat (limited to 'clang/tools/libclang/CXSourceLocation.h')
-rw-r--r-- | clang/tools/libclang/CXSourceLocation.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/tools/libclang/CXSourceLocation.h b/clang/tools/libclang/CXSourceLocation.h index 235f78c5a1b..7a502059634 100644 --- a/clang/tools/libclang/CXSourceLocation.h +++ b/clang/tools/libclang/CXSourceLocation.h @@ -29,6 +29,9 @@ namespace cxloc { static inline CXSourceLocation translateSourceLocation(const SourceManager &SM, const LangOptions &LangOpts, SourceLocation Loc) { + if (Loc.isInvalid()) + clang_getNullLocation(); + CXSourceLocation Result = { { (void*) &SM, (void*) &LangOpts, }, Loc.getRawEncoding() }; return Result; |