diff options
| author | Hans Wennborg <hans@hanshq.net> | 2011-06-30 20:17:41 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2011-06-30 20:17:41 +0000 |
| commit | 77d1abef075b54c26cab89abd1f26542c0ab4831 (patch) | |
| tree | 5955fbc393032cd1339c18f667c04f7b21f8ca19 /clang/lib/AST | |
| parent | b10a0f223afbb01df04ef736372e899e8f5edbfe (diff) | |
| download | bcm5719-llvm-77d1abef075b54c26cab89abd1f26542c0ab4831.tar.gz bcm5719-llvm-77d1abef075b54c26cab89abd1f26542c0ab4831.zip | |
Fix off-by-one error in StringLiteral::getLocationOfByte.
This fixes PR10223.
llvm-svn: 134183
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index fdcb77f3247..1d0319f6014 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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 |

