This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
code points above 0x7fff_ffff problematic
authorKarl Williamson <public@khwilliamson.com>
Thu, 3 Feb 2011 00:03:33 +0000 (17:03 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 3 Feb 2011 00:34:24 +0000 (17:34 -0700)
The analysis by the submitter was correct.

t/op/qq.t
utf8.h

index 0136608..65e3e82 100644 (file)
--- a/t/op/qq.t
+++ b/t/op/qq.t
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print q(1..29
+print q(1..30
 );
 
 # This is() function is written to avoid ""
@@ -87,3 +87,7 @@ else {  # Something wrong; someone has removed the failure in util.c
     is ("Should fail for 5.13 until fix test", "0");
     is ("1", "1");
 }
+
+# This caused a memory fault
+no warnings "utf8";
+is ("abc", eval qq[qq\x{8000_0000}abc\x{8000_0000}])
diff --git a/utf8.h b/utf8.h
index 9fa9e90..88589a0 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -268,10 +268,9 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
 #define UTF8_ALLOW_FFFF 0
 #define UTF8_ALLOW_SURROGATE 0
 
-#define UTF8_DISALLOW_ILLEGAL_INTERCHANGE \
-           (UTF8_DISALLOW_SUPER|UTF8_DISALLOW_NONCHAR|UTF8_DISALLOW_SURROGATE)
+#define UTF8_DISALLOW_ILLEGAL_INTERCHANGE (UTF8_DISALLOW_SUPER|UTF8_DISALLOW_NONCHAR|UTF8_DISALLOW_SURROGATE|UTF8_DISALLOW_FE_FF)
 #define UTF8_WARN_ILLEGAL_INTERCHANGE \
-                       (UTF8_WARN_SUPER|UTF8_WARN_NONCHAR|UTF8_WARN_SURROGATE)
+       (UTF8_WARN_SUPER|UTF8_WARN_NONCHAR|UTF8_WARN_SURROGATE|UTF8_WARN_FE_FF)
 #define UTF8_ALLOW_ANY \
            (~(UTF8_DISALLOW_ILLEGAL_INTERCHANGE|UTF8_WARN_ILLEGAL_INTERCHANGE))
 #define UTF8_ALLOW_ANYUV                                                        \