]> granicus.if.org Git - clang/commit
Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 7 May 2013 04:29:22 +0000 (04:29 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 7 May 2013 04:29:22 +0000 (04:29 +0000)
commitb18840ddd6aa472bbf78ab9de59159eb128fb6a9
treec0ca7cda6fc4d20c19255bb00bf2d0c99f8ca95b
parenta8942d7686dde6d221a176c502ce857bdc409dab
Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.

This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location
when the the FileID is for an empty file.

rdar://13803893

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181285 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/SourceManager.h
lib/Rewrite/Frontend/InclusionRewriter.cpp
test/Index/Inputs/empty.h [new file with mode: 0644]
test/Index/file-includes.c