aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-11 21:39:18 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-05-11 21:39:18 +0000
commitdf8755884e039d3f313ee0fea42b955257b5e240 (patch)
tree26513c4ed7ca970b3b266d35056c2a03d92deb69 /lib/AST/Expr.cpp
parent8aeb1471ef62a4befba00721925a3717914f21d8 (diff)
The Lexer constructor expects a source location at the start of the
file buffer, not at the start of lexing. Fixes assertion hit in format diagnostics. rdar://11418366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index afc7410a81..ba2cc8eb34 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -708,8 +708,8 @@ getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
LangOpts.Trigraphs = true;
// Create a lexer starting at the beginning of this token.
- Lexer TheLexer(StrTokSpellingLoc, Features, Buffer.begin(), StrData,
- Buffer.end());
+ Lexer TheLexer(SM.getLocForStartOfFile(LocInfo.first), Features,
+ Buffer.begin(), StrData, Buffer.end());
Token TheTok;
TheLexer.LexFromRawLexer(TheTok);