diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-09-27 21:24:36 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-09-27 21:24:36 +0000 |
commit | 78fe2ba3ba92c25b4b1ae42027081af16f0ddf06 (patch) | |
tree | fbd5beb795fa828e3335d6203b500f91531ba611 /llvm/lib/Support/SourceMgr.cpp | |
parent | 30e9b6c47d8891b68f8cea1125987e4a0b8b6a82 (diff) | |
download | bcm5719-llvm-78fe2ba3ba92c25b4b1ae42027081af16f0ddf06.tar.gz bcm5719-llvm-78fe2ba3ba92c25b4b1ae42027081af16f0ddf06.zip |
SourceMgr diagnotics printing: fix a bug where printing a fixit for a source
range that includes a tab character will cause out-of-bounds access to the
fixit string.
llvm-svn: 191563
Diffstat (limited to 'llvm/lib/Support/SourceMgr.cpp')
-rw-r--r-- | llvm/lib/Support/SourceMgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index fbcd8f980c1..d4b94f8cd5d 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -470,7 +470,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, if (FixItInsertionLine.empty()) return; - for (size_t i = 0, e = FixItInsertionLine.size(), OutCol = 0; i != e; ++i) { + for (size_t i = 0, e = FixItInsertionLine.size(), OutCol = 0; i < e; ++i) { if (i >= LineContents.size() || LineContents[i] != '\t') { S << FixItInsertionLine[i]; ++OutCol; |