[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r9846 - in /fsf/trunk/libc: ChangeLog sysdeps/s390/s390-64/utf16-utf32-z9.c sysdeps/s390/s390-64/utf8-utf16-z9.c



Author: eglibc
Date: Fri Feb 12 00:03:11 2010
New Revision: 9846

Log:
Import glibc-mainline for 2010-02-12

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
    fsf/trunk/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Feb 12 00:03:11 2010
@@ -1,3 +1,10 @@
+2010-02-11  Andreas Krebbel  <Andreas.Krebbel@xxxxxxxxxx>
+
+	* sysdeps/s390/s390-64/utf8-utf16-z9.c: Disable hardware
+	instructions cu21 and cu24.  Add well-formedness checking
+	parameter and adjust the software implementation.
+	* sysdeps/s390/s390-64/utf16-utf32-z9.c: Likewise.
+
 2010-02-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #11271]

Modified: fsf/trunk/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-64/utf16-utf32-z9.c Fri Feb 12 00:03:11 2010
@@ -203,7 +203,10 @@
    swapping).  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
       {									\
 	HARDWARE_CONVERT ("cu24 %0, %1, 1");				\
 	if (inptr != inend)						\
@@ -229,6 +232,12 @@
       }									\
     else								\
       {									\
+        /* An isolated low-surrogate was found.  This has to be         \
+	   considered ill-formed.  */					\
+        if (__builtin_expect (u1 >= 0xdc00, 0))				\
+	  {								\
+	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				\
+	  }								\
 	/* It's a surrogate character.  At least the first word says	\
 	   it is.  */							\
 	if (__builtin_expect (inptr + 4 > inend, 0))			\

Modified: fsf/trunk/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c (original)
+++ fsf/trunk/libc/sysdeps/s390/s390-64/utf8-utf16-z9.c Fri Feb 12 00:03:11 2010
@@ -345,9 +345,12 @@
    Operation.  */
 #define BODY								\
   {									\
-    if (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH)				\
-      {									\
-	HARDWARE_CONVERT ("cu21 %0, %1");				\
+    /* The hardware instruction currently fails to report an error for	\
+       isolated low surrogates so we have to disable the instruction	\
+       until this gets resolved.  */					\
+    if (0) /* (GLRO (dl_hwcap) & HWCAP_S390_ETF3EH) */			\
+      {									\
+	HARDWARE_CONVERT ("cu21 %0, %1, 1");				\
 	if (inptr != inend)						\
 	  {								\
 	    /* Check if the third byte is				\
@@ -388,7 +391,7 @@
 									\
 	outptr += 2;							\
       }									\
-    else if (c >= 0x0800 && c <= 0xd7ff)				\
+    else if ((c >= 0x0800 && c <= 0xd7ff) || c > 0xdfff)		\
       {									\
 	/* Three byte UTF-8 char.  */					\
 									\