develooper Front page | perl.perl5.porters | Postings from November 2005

Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)

Thread Previous | Thread Next
From:
SADAHIRO Tomoyuki
Date:
November 23, 2005 03:28
Subject:
Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)
Message ID:
20051123202935.4D9D.BQW10602@nifty.com
On Wed, 23 Nov 2005 17:57:34 +0900, SADAHIRO Tomoyuki wrote
> The patch gzipped (against perl patch 26198) is attached to this mail
> as swashget.patch.gz

I must report that this patch has a bug that perl will crash
when the last line of $self->{EXTRAS} does not have \n at the end.

The patch following is an additional patch against the previous patch.

Regards 
SADAHIRO Tomoyuki

diff -ur perl~/t/op/pat.t perl/t/op/pat.t
--- perl~/t/op/pat.t	Tue Nov 22 13:08:47 2005
+++ perl/t/op/pat.t	Wed Nov 23 20:18:25 2005
@@ -6,7 +6,7 @@
 
 $| = 1;
 
-print "1..1187\n";
+print "1..1191\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -3006,6 +3006,15 @@
 print "\x{0712}" =~ /\p{Syriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
 print "\x{072F}" =~ /\P{Syriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
 
+print "# user-defined character properties may lack \\n at the end\n";
+sub InGreekSmall   { return "03B1\t03C9" }
+sub InGreekCapital { return "0391\t03A9\n-03A2" }
+
+ok("\x{03C0}" =~ /\p{InGreekSmall}/,   "Small pi");
+ok("\x{03C2}" =~ /\p{InGreekSmall}/,   "Final sigma");
+ok("\x{03A0}" =~ /\p{InGreekCapital}/, "Capital PI");
+ok("\x{03A2}" =~ /\P{InGreekCapital}/, "Reserved");
+
 {
     print "# Change #18179\n";
     # previously failed with "panic: end_shift
@@ -3402,5 +3411,5 @@
        "# TODO assigning to original string should not corrupt match vars");
 }
 
-# last test 1187
+# last test 1191
 
diff -ur perl~/universal.c perl/universal.c
--- perl~/universal.c	Wed Nov 23 16:23:48 2005
+++ perl/universal.c	Wed Nov 23 18:34:05 2005
@@ -1195,12 +1195,15 @@
 	    }
 
 	    namestr = x;
-	    namelen = nextline - x;
 
-	    if (nextline)
+	    if (nextline) {
+		namelen = nextline - namestr;
 		x = nextline + 1;
-	    else
+	    }
+	    else {
+		namelen = xend - namestr;
 		x = xend;
+	    }
 
 	    if (debug) {
 		char* tmpstr;
### End of patch ###



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About