Change 33265: [perl #49472] Attributes + Unkown Error

2008-02-09 Thread Dave Mitchell
Change 33265 by [EMAIL PROTECTED] on 2008/02/09 14:56:23

[perl #49472] Attributes + Unkown Error
An errored attribute sub still processes the attributes,
which require's attribute.pm, so make sure the error state is
passed to the new require

Affected files ...

... //depot/perl/t/comp/require.t#43 edit
... //depot/perl/toke.c#816 edit

Differences ...

 //depot/perl/t/comp/require.t#43 (xtext) 
Index: perl/t/comp/require.t
--- perl/t/comp/require.t#42~32084~ 2007-10-09 10:03:53.0 -0700
+++ perl/t/comp/require.t   2008-02-09 06:56:23.0 -0800
@@ -15,7 +15,7 @@
 
 my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0;
 my $Is_UTF8   = (${^OPEN} || ) =~ /:utf8/;
-my $total_tests = 49;
+my $total_tests = 50;
 if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; }
 print 1..$total_tests\n;
 
@@ -258,6 +258,20 @@
 }
 }
 
+#  [perl #49472] Attributes + Unkown Error
+
+{
+do_require
+   'use strict;sub MODIFY_CODE_ATTRIBUTE{} sub f:Blah {$nosuchvar}';
+my $err = $@;
+$err .= \n unless $err =~ /\n$/;
+unless ($err =~ /Global symbol \$nosuchvar requires /) {
+   $err =~ s/^/# /mg;
+   print ${err}not ;
+}
+print ok , ++$i,  [perl #49472]\n;
+}
+
 ##
 # What follows are UTF-8 specific tests. #
 # Add generic tests before this point.   #

 //depot/perl/toke.c#816 (text) 
Index: perl/toke.c
--- perl/toke.c#815~33103~  2008-01-29 02:53:24.0 -0800
+++ perl/toke.c 2008-02-09 06:56:23.0 -0800
@@ -692,6 +692,7 @@
 #else
 parser-nexttoke = 0;
 #endif
+parser-error_count = oparser ? oparser-error_count : 0;
 parser-copline = NOLINE;
 parser-lex_state = LEX_NORMAL;
 parser-expect = XSTATE;
End of Patch.


Change 33266: Upgrade to Time-HiRes-1.9712

2008-02-09 Thread Steve Peters
Change 33266 by [EMAIL PROTECTED] on 2008/02/10 05:05:28

Upgrade to Time-HiRes-1.9712

Affected files ...

... //depot/perl/ext/Time/HiRes/HiRes.pm#79 edit
... //depot/perl/ext/Time/HiRes/Makefile.PL#48 edit
... //depot/perl/ext/Time/HiRes/t/HiRes.t#33 edit

Differences ...

 //depot/perl/ext/Time/HiRes/HiRes.pm#79 (text) 
Index: perl/ext/Time/HiRes/HiRes.pm
--- perl/ext/Time/HiRes/HiRes.pm#78~32557~  2007-11-29 21:05:15.0 
-0800
+++ perl/ext/Time/HiRes/HiRes.pm2008-02-09 21:05:28.0 -0800
@@ -23,7 +23,7 @@
 stat
);

-$VERSION = '1.9711';
+$VERSION = '1.9712';
 $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 

 //depot/perl/ext/Time/HiRes/Makefile.PL#48 (text) 
Index: perl/ext/Time/HiRes/Makefile.PL
--- perl/ext/Time/HiRes/Makefile.PL#47~33259~   2008-02-08 11:11:19.0 
-0800
+++ perl/ext/Time/HiRes/Makefile.PL 2008-02-09 21:05:28.0 -0800
@@ -851,19 +851,20 @@
print  EOM;
 Now you may issue '$make'.  Do not forget also '$make test'.
 EOM
-   if ((exists $ENV{LC_ALL}$ENV{LC_ALL}   =~ /utf-?8/i) ||
-   (exists $ENV{LC_CTYPE}  $ENV{LC_CTYPE} =~ /utf-?8/i) ||
-   (exists $ENV{LANG}  $ENV{LANG} =~ /utf-?8/i)) {
+   if ($] == 5.008 
+  ((exists $ENV{LC_ALL}$ENV{LC_ALL}   =~ /utf-?8/i) ||
+   (exists $ENV{LC_CTYPE}  $ENV{LC_CTYPE} =~ /utf-?8/i) ||
+   (exists $ENV{LANG}  $ENV{LANG} =~ /utf-?8/i))) {
 print EOM;
 
 NOTE: if you get an error like this (the Makefile line number may vary):
 Makefile:91: *** missing separator
 then set the environment variable LC_ALL to C and retry
 from scratch (re-run perl Makefile.PL).
-(And consider upgrading your Perl.)
+(And consider upgrading your Perl to, say, at least Perl 5.8.8.)
 (You got this message because you seem to have
  an UTF-8 locale active in your shell environment, this used
- to cause broken Makefiles to be created from Makefile.PLs.)
+ to cause broken Makefiles to be created from Makefile.PLs)
 EOM
 }
 }

 //depot/perl/ext/Time/HiRes/t/HiRes.t#33 (text) 
Index: perl/ext/Time/HiRes/t/HiRes.t
--- perl/ext/Time/HiRes/t/HiRes.t#32~32557~ 2007-11-29 21:05:15.0 
-0800
+++ perl/ext/Time/HiRes/t/HiRes.t   2008-02-09 21:05:28.0 -0800
@@ -271,19 +271,6 @@
# Perl's deferred signals may be too wimpy to break through
# a restartable select(), so use POSIX::sigaction if available.
 
-   sub tick {
-   $i--;
-   my $ival = Time::HiRes::tv_interval ($r);
-   print # Tick! $i $ival\n;
-   my $exp = 0.3 * (5 - $i);
-   # This test is more sensitive, so impose a softer limit.
-   if (abs($ival/$exp - 1)  4*$limit) {
-   my $ratio = abs($ival/$exp);
-   $not = tick: $exp sleep took $ival ratio $ratio;
-   $i = 0;
-   }
-   }
-
POSIX::sigaction(POSIX::SIGALRM,
 POSIX::SigAction-new(tick),
 $oldaction)
@@ -315,7 +302,7 @@
}
my $exp = 0.3 * (5 - $i);
# This test is more sensitive, so impose a softer limit.
-   if (abs($ival/$exp - 1)  3*$limit) {
+   if (abs($ival/$exp - 1)  4*$limit) {
my $ratio = abs($ival/$exp);
$not = while: $exp sleep took $ival ratio $ratio;
last;
@@ -324,6 +311,19 @@
}
 }
 
+sub tick {
+   $i--;
+   my $ival = Time::HiRes::tv_interval ($r);
+   print # Tick! $i $ival\n;
+   my $exp = 0.3 * (5 - $i);
+   # This test is more sensitive, so impose a softer limit.
+   if (abs($ival/$exp - 1)  4*$limit) {
+   my $ratio = abs($ival/$exp);
+   $not = tick: $exp sleep took $ival ratio $ratio;
+   $i = 0;
+   }
+}
+
 if ($use_sigaction) {
POSIX::sigaction(POSIX::SIGALRM, $oldaction);
 } else {
End of Patch.


Change 33267: [patch] optimize OP_IS_(FILETEST|SOCKET) macros

2008-02-09 Thread Nicholas Clark
Change 33267 by [EMAIL PROTECTED] on 2008/02/10 07:35:45

Subject: [patch] optimize OP_IS_(FILETEST|SOCKET) macros
From: Jim Cromie [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Date: Sat, 09 Feb 2008 07:56:59 -0700

Affected files ...

... //depot/perl/opcode.h#148 edit
... //depot/perl/opcode.pl#171 edit
... //depot/perl/opnames.h#28 edit
... //depot/perl/pp.sym#40 edit
... //depot/perl/pp_proto.h#48 edit

Differences ...

 //depot/perl/opcode.h#148 (text+w) 
Index: perl/opcode.h
--- perl/opcode.h#147~33072~2008-01-26 02:46:12.0 -0800
+++ perl/opcode.h   2008-02-09 23:35:45.0 -0800
@@ -261,8 +261,6 @@
sysseek,
sysread,
syswrite,
-   send,
-   recv,
eof,
tell,
seek,
@@ -270,6 +268,8 @@
fcntl,
ioctl,
flock,
+   send,
+   recv,
socket,
sockpair,
bind,
@@ -632,8 +632,6 @@
sysseek,
sysread,
syswrite,
-   send,
-   recv,
eof,
tell,
seek,
@@ -641,6 +639,8 @@
fcntl,
ioctl,
flock,
+   send,
+   recv,
socket,
socketpair,
bind,
@@ -1017,8 +1017,6 @@
MEMBER_TO_FPTR(Perl_pp_sysseek),
MEMBER_TO_FPTR(Perl_pp_sysread),
MEMBER_TO_FPTR(Perl_pp_send),   /* Perl_pp_syswrite */
-   MEMBER_TO_FPTR(Perl_pp_send),
-   MEMBER_TO_FPTR(Perl_pp_sysread),/* Perl_pp_recv */
MEMBER_TO_FPTR(Perl_pp_eof),
MEMBER_TO_FPTR(Perl_pp_tell),
MEMBER_TO_FPTR(Perl_pp_sysseek),/* Perl_pp_seek */
@@ -1026,6 +1024,8 @@
MEMBER_TO_FPTR(Perl_pp_ioctl),  /* Perl_pp_fcntl */
MEMBER_TO_FPTR(Perl_pp_ioctl),
MEMBER_TO_FPTR(Perl_pp_flock),
+   MEMBER_TO_FPTR(Perl_pp_send),
+   MEMBER_TO_FPTR(Perl_pp_sysread),/* Perl_pp_recv */
MEMBER_TO_FPTR(Perl_pp_socket),
MEMBER_TO_FPTR(Perl_pp_sockpair),
MEMBER_TO_FPTR(Perl_pp_bind),
@@ -1399,8 +1399,6 @@
MEMBER_TO_FPTR(Perl_ck_fun),/* sysseek */
MEMBER_TO_FPTR(Perl_ck_fun),/* sysread */
MEMBER_TO_FPTR(Perl_ck_fun),/* syswrite */
-   MEMBER_TO_FPTR(Perl_ck_fun),/* send */
-   MEMBER_TO_FPTR(Perl_ck_fun),/* recv */
MEMBER_TO_FPTR(Perl_ck_eof),/* eof */
MEMBER_TO_FPTR(Perl_ck_fun),/* tell */
MEMBER_TO_FPTR(Perl_ck_fun),/* seek */
@@ -1408,6 +1406,8 @@
MEMBER_TO_FPTR(Perl_ck_fun),/* fcntl */
MEMBER_TO_FPTR(Perl_ck_fun),/* ioctl */
MEMBER_TO_FPTR(Perl_ck_fun),/* flock */
+   MEMBER_TO_FPTR(Perl_ck_fun),/* send */
+   MEMBER_TO_FPTR(Perl_ck_fun),/* recv */
MEMBER_TO_FPTR(Perl_ck_fun),/* socket */
MEMBER_TO_FPTR(Perl_ck_fun),/* sockpair */
MEMBER_TO_FPTR(Perl_ck_fun),/* bind */
@@ -1775,8 +1775,6 @@
0x0022c804, /* sysseek */
0x122ec81d, /* sysread */
0x1322c81d, /* syswrite */
-   0x1222c81d, /* send */
-   0x022ec81d, /* recv */
0x0001d614, /* eof */
0x0001d60c, /* tell */
0x0022c804, /* seek */
@@ -1784,6 +1782,8 @@
0x0022c80c, /* fcntl */
0x0022c80c, /* ioctl */
0x0002c91c, /* flock */
+   0x1222c81d, /* send */
+   0x022ec81d, /* recv */
0x0222c814, /* socket */
0x222cc814, /* sockpair */
0x0002c814, /* bind */

 //depot/perl/opcode.pl#171 (xtext) 
Index: perl/opcode.pl
--- perl/opcode.pl#170~33072~   2008-01-26 02:46:12.0 -0800
+++ perl/opcode.pl  2008-02-09 23:35:45.0 -0800
@@ -17,7 +17,7 @@
 # Read data.
 
 my %seen;
-my (@ops, %desc, %check, %ckname, %flags, %args);
+my (@ops, %desc, %check, %ckname, %flags, %args, %opnum);
 
 while (DATA) {
 chop;
@@ -32,6 +32,7 @@
 $seen{$key} = qq[opcode $key];
 
 push(@ops, $key);
+$opnum{$key} = $#ops;
 $desc{$key} = $desc;
 $check{$key} = $check;
 $ckname{$check}++;
@@ -149,7 +150,8 @@
 
 my $i = 0;
 for (@ops) {
-print ON \t, tab(3,OP_\U$_,), /* , $i++,  */\n;
+# print ON \t, tab(3,OP_\U$_,), /* , $i++,  */\n;
+  print ON \t, tab(3,OP_\U$_),  = , $i++, ,\n;
 }
 print ON \t, tab(3,OP_max), \n;
 print ON } opcode;\n;
@@ -361,8 +363,9 @@
 my $argshift = $OASHIFT;
 for my $arg (split(' ',$args{$op})) {
if ($arg =~ /^F/) {
-   $OP_IS_SOCKET{$op}   = 1 if $arg =~ s/s//;
-   $OP_IS_FILETEST{$op} = 1 if $arg =~ s/-//;
+   # record opnums of these opnames
+   $OP_IS_SOCKET{$op}   = $opnum{$op} if $arg =~ s/s//;
+   $OP_IS_FILETEST{$op} = $opnum{$op} if $arg =~ s/-//;
 }
my $argnum = ($arg =~ s/\?//) ? 8 : 0;
 die op = $op, arg = $arg\n
@@ -388,18 +391,46 @@
 
 END
 
-if (keys %OP_IS_SOCKET) {
-print ON \n#define OP_IS_SOCKET(op)   \\\n\t(;
-print ON join( || \\\n\t ,