We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d82050 commit 17980bdCopy full SHA for 17980bd
clang/include/clang/Basic/SourceManager.h
@@ -1275,8 +1275,10 @@ class SourceManager : public RefCountedBase<SourceManager> {
1275
/// start of the buffer of the location.
1276
FileIDAndOffset getDecomposedLoc(SourceLocation Loc) const {
1277
FileID FID = getFileID(Loc);
1278
- const SrcMgr::SLocEntry &Entry = getSLocEntry(FID);
1279
- return std::make_pair(FID, Loc.getOffset() - Entry.getOffset());
+ auto *Entry = getSLocEntryOrNull(FID);
+ if (!Entry)
1280
+ return std::make_pair(FileID(), 0);
1281
+ return std::make_pair(FID, Loc.getOffset() - Entry->getOffset());
1282
}
1283
1284
/// Decompose the specified location into a raw FileID + Offset pair.
0 commit comments