[cfe-commits] r167006 - /cfe/trunk/lib/Frontend/TextDiagnostic.cpp

Seth Cantrell seth.cantrell at gmail.com
Mon Oct 29 23:13:50 PDT 2012


Author: socantre
Date: Tue Oct 30 01:13:50 2012
New Revision: 167006

URL: http://llvm.org/viewvc/llvm-project?rev=167006&view=rev
Log:
fix calculation of end pointer

Modified:
    cfe/trunk/lib/Frontend/TextDiagnostic.cpp

Modified: cfe/trunk/lib/Frontend/TextDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnostic.cpp?rev=167006&r1=167005&r2=167006&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnostic.cpp Tue Oct 30 01:13:50 2012
@@ -127,7 +127,7 @@
 
   unsigned char const *begin, *end;
   begin = reinterpret_cast<unsigned char const *>(&*(SourceLine.begin() + *i));
-  end = begin + SourceLine.size();
+  end = begin + (SourceLine.size() - *i);
   
   if (isLegalUTF8Sequence(begin, end)) {
     UTF32 c;





More information about the cfe-commits mailing list