aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2011-06-30 20:17:41 +0000
committerHans Wennborg <hans@hanshq.net>2011-06-30 20:17:41 +0000
commit935a70c1e76d78985f20d422940280161b941299 (patch)
tree87b1b4e0c92c1ac7e6a3027f569f21336a25c468 /lib/AST/Expr.cpp
parent150fee8b2ba3ea6faa12e68cb58adc5e2fc73825 (diff)
Fix off-by-one error in StringLiteral::getLocationOfByte.
This fixes PR10223. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index fdcb77f324..1d0319f601 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -593,7 +593,7 @@ getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
// If the byte is in this token, return the location of the byte.
if (ByteNo < TokNumBytes ||
- (ByteNo == TokNumBytes && TokNo == getNumConcatenated())) {
+ (ByteNo == TokNumBytes && TokNo == getNumConcatenated() - 1)) {
unsigned Offset = SLP.getOffsetOfStringByte(TheTok, ByteNo);
// Now that we know the offset of the token in the spelling, use the