fix bug in SourceColumnMap::startOfPreviousColumn

llvm-svn: 167360
This commit is contained in:
Seth Cantrell 2012-11-03 21:21:14 +00:00
parent f9db130715
commit d38c708dc1
2 changed files with 9 additions and 1 deletions

View File

@ -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;
}

View File

@ -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|`?ò;;Æ¿V\\ù€‡ûݪW9úТ:ÌŠO EøÛ<C3B8>y?SKªy¦¹‡Øài&n";
}
// CHECK-NOT:Assertion