[cfe-commits] r167360 - in /cfe/trunk: lib/Frontend/TextDiagnostic.cpp test/Misc/wrong-encoding2.c

Seth Cantrell seth.cantrell at gmail.com
Sat Nov 3 14:21:14 PDT 2012


Author: socantre
Date: Sat Nov  3 16:21:14 2012
New Revision: 167360

URL: http://llvm.org/viewvc/llvm-project?rev=167360&view=rev
Log:
fix bug in SourceColumnMap::startOfPreviousColumn

Added:
    cfe/trunk/test/Misc/wrong-encoding2.c
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=167360&r1=167359&r2=167360&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnostic.cpp Sat Nov  3 16:21:14 2012
@@ -298,7 +298,7 @@
   /// \brief Map from a byte index to the previous byte which starts a column.
   int startOfPreviousColumn(int N) const {
     assert(0 < N && N < static_cast<int>(m_columnToByte.size()));
-    while (byteToColumn(N--) == -1) {}
+    while (byteToColumn(--N) == -1) {}
     return N;
   }
 

Added: cfe/trunk/test/Misc/wrong-encoding2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/wrong-encoding2.c?rev=167360&view=auto
==============================================================================
--- cfe/trunk/test/Misc/wrong-encoding2.c (added)
+++ cfe/trunk/test/Misc/wrong-encoding2.c Sat Nov  3 16:21:14 2012
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -fmessage-length 100 %s 2>&1 | FileCheck -strict-whitespace %s
+// REQUIRES: asserts
+
+int main() {
+    "É#x#p)6Ò)ѽŠ$ûž>U êhÑüÃö|Ÿ থϻgŸY|`?ò;;Æ¿VjÇ\\ù€‡ûݪW9úТ:̊O Eøېy?SKªy¦¹‡Øài&n";
+}
+
+// CHECK-NOT:Assertion





More information about the cfe-commits mailing list