This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add a new define for testing perl #115078
authorYves Orton <demerphq@gmail.com>
Sat, 29 Sep 2012 20:55:13 +0000 (22:55 +0200)
committerYves Orton <demerphq@gmail.com>
Sat, 29 Sep 2012 20:57:41 +0000 (22:57 +0200)
We dont have any easy way to test regen/regcharclass.pl currently.
Perl #115078 is related to a bug in the _cleanup() routine which is
fixed with next patch.

regcharclass.h
regen/regcharclass.pl

index f9c828d..0b1beb5 100644 (file)
     : 0 )                                                                   \
 : 0 )
 
+/*
+       FOR_TESTING_DEMO: This is used to test if we generate incorrect code (currently is bad)
+
+       "\x{3B7}\x{342}"
+       "\x{3B9}\x{308}\x{301}"
+*/
+/*** GENERATED CODE ***/
+#define is_FOR_TESTING_DEMO_utf8_safe(s,e)                                  \
+( ( ((e)-(s) > 5) && ( 0xCE == ((U8*)s)[0] ) ) ? ( ( 0xB7 == ((U8*)s)[1] ) ?\
+           ( ( 0xCD == ((U8*)s)[2] ) ?                                     \
+               ( ( 0x82 == ((U8*)s)[3] ) ? 4 : 0 )                         \
+       : ( 0xB9 == ((U8*)s)[1] ) ?                                         \
+           ( ( ( ( ( 0xCC == ((U8*)s)[2] ) && ( 0x88 == ((U8*)s)[3] ) ) && ( 0xCC == ((U8*)s)[4] ) ) && ( 0x81 == ((U8*)s)[5] ) ) ? 6 : 0 )\
+       : 0 )                                                               \
+    : 0 )                                                                   \
+: ((e)-(s) > 3) ?                                                           \
+    ( ( ( ( ( 0xCE == ((U8*)s)[0] ) && ( 0xB7 == ((U8*)s)[1] ) ) && ( 0xCD == ((U8*)s)[2] ) ) && ( 0x82 == ((U8*)s)[3] ) ) ? 4 : 0 )\
+: 0 )
+
 
 #endif /* H_REGCHARCLASS */
 
index b22a8a9..ab3302d 100755 (executable)
@@ -1181,3 +1181,8 @@ UTF8_CHAR: Matches utf8 from 1 to 5 bytes
 QUOTEMETA: Meta-characters that \Q should quote
 => high :fast
 \p{_Perl_Quotemeta}
+
+FOR_TESTING_DEMO: This is used to test if we generate incorrect code (currently is bad)
+=> UTF8 :safe
+"\x{3B7}\x{342}"
+"\x{3B9}\x{308}\x{301}"