diff options
author | Seth Cantrell <seth.cantrell@gmail.com> | 2012-10-30 23:50:26 +0000 |
---|---|---|
committer | Seth Cantrell <seth.cantrell@gmail.com> | 2012-10-30 23:50:26 +0000 |
commit | 31ba273ef83d648ac78d96a4205ffad6b3e430a6 (patch) | |
tree | 3463cb6cc5eee152ec5ca42c8dd680c2ea3e869d /lib/Basic/ConvertUTF.c | |
parent | e6c3458723d954d1ba9b73a2d93d2e2d67dd3510 (diff) |
isLegalUTF8() was giving the wrong answer
invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/ConvertUTF.c')
-rw-r--r-- | lib/Basic/ConvertUTF.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Basic/ConvertUTF.c b/lib/Basic/ConvertUTF.c index ec57be701a..d16965ddd8 100644 --- a/lib/Basic/ConvertUTF.c +++ b/lib/Basic/ConvertUTF.c @@ -359,7 +359,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) { /* Everything else falls through when "true"... */ case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 2: if ((a = (*--srcptr)) > 0xBF) return false; + case 2: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; switch (*source) { /* no fall-through in this inner switch */ |