aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Frontend/TextDiagnostic.cpp2
-rw-r--r--test/Misc/wrong-encoding2.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp
index d622fb35f0..0eb3d60e0b 100644
--- a/lib/Frontend/TextDiagnostic.cpp
+++ b/lib/Frontend/TextDiagnostic.cpp
@@ -298,7 +298,7 @@ struct SourceColumnMap {
/// \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;
}
diff --git a/test/Misc/wrong-encoding2.c b/test/Misc/wrong-encoding2.c
new file mode 100644
index 0000000000..43a0f4e900
--- /dev/null
+++ b/test/Misc/wrong-encoding2.c
@@ -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| থϻgY|`?;;ƿVj\\ݪW9:̊OEېy?SKyi&n";
+}
+
+// CHECK-NOT:Assertion