[cfe-commits] r167063 - /cfe/trunk/lib/Basic/ConvertUTF.c

Seth Cantrell seth.cantrell at gmail.com
Tue Oct 30 16:50:27 PDT 2012


Author: socantre
Date: Tue Oct 30 18:50:26 2012
New Revision: 167063

URL: http://llvm.org/viewvc/llvm-project?rev=167063&view=rev
Log:
isLegalUTF8() was giving the wrong answer

invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84

Modified:
    cfe/trunk/lib/Basic/ConvertUTF.c

Modified: cfe/trunk/lib/Basic/ConvertUTF.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/ConvertUTF.c?rev=167063&r1=167062&r2=167063&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/ConvertUTF.c (original)
+++ cfe/trunk/lib/Basic/ConvertUTF.c Tue Oct 30 18:50:26 2012
@@ -359,7 +359,7 @@
         /* 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 */





More information about the cfe-commits mailing list