Change 30098 by [EMAIL PROTECTED] on 2007/02/02 20:54:46

        Integrate:
        [ 29193]
        eval $undef should emit one warning, not three.
        Also ensure that eval $undef clears $@ (it did, but only by luck)
        
        [ 29194]
        add test that eval undef clears $@
        
        [ 29195]
        Change #29193 makes this addition unneeded

Affected files ...

... //depot/maint-5.8/perl/pp_ctl.c#168 integrate
... //depot/maint-5.8/perl/t/lib/common.pl#2 integrate
... //depot/maint-5.8/perl/t/op/eval.t#7 integrate
... //depot/maint-5.8/perl/toke.c#162 integrate

Differences ...

==== //depot/maint-5.8/perl/pp_ctl.c#168 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#167~30075~    2007-01-29 15:16:13.000000000 -0800
+++ perl/pp_ctl.c       2007-02-02 12:54:46.000000000 -0800
@@ -3413,8 +3413,6 @@
     const char * const fakestr = "_<(eval )";
     const int fakelen = 9 + 1;
 
-    if (!SvPV_nolen_const(sv))
-       RETPUSHUNDEF;
     TAINT_PROPER("eval");
 
     ENTER;

==== //depot/maint-5.8/perl/t/lib/common.pl#2 (text) ====
Index: perl/t/lib/common.pl
--- perl/t/lib/common.pl#1~30097~       2007-02-02 12:40:18.000000000 -0800
+++ perl/t/lib/common.pl        2007-02-02 12:54:46.000000000 -0800
@@ -58,12 +58,6 @@
 
 plan tests => (scalar(@prgs)-$files);
 
-my $utf8_ok = exists $ENV{PERL_UNICODE} && (
-    $ENV{PERL_UNICODE} =~ m{[Dio]}
-    || ($ENV{PERL_UNICODE} eq ""
-           && ($ENV{LC_ALL} =~ /\butf-?8\b/i || $ENV{LANG} =~ /\butf-?8\b/i))
-);
-
 for (@prgs){
     unless (/\n/)
      {
@@ -77,11 +71,6 @@
         $switch = $&;
     }
     my($prog,$expected) = split(/\nEXPECT(?:\n|$)/, $_, 2);
-    $expected =~ s{\b
-       UTF8 \s*
-           \? \s* '(.*?)'
-            : \s* '(.*?)'
-           }{$utf8_ok?$1:$2}gexs;
 
     my ($todo, $todo_reason);
     $todo = $prog =~ s/^#\s*TODO(.*)\n//m and $todo_reason = $1;

==== //depot/maint-5.8/perl/t/op/eval.t#7 (xtext) ====
Index: perl/t/op/eval.t
--- perl/t/op/eval.t#6~19803~   2003-06-16 22:18:41.000000000 -0700
+++ perl/t/op/eval.t    2007-02-02 12:54:46.000000000 -0800
@@ -5,7 +5,7 @@
     @INC = '../lib';
 }
 
-print "1..91\n";
+print "1..92\n";
 
 eval 'print "ok 1\n";';
 
@@ -438,3 +438,12 @@
   eval $code;
   print   $c   eq 'V'  ? "ok " : "# '$c' ne 'V'\nnot ok ", $test++, "\n";
 }
+# eval undef should be the same as eval "" barring any warnings
+
+{
+    local $@ = "foo";
+    eval undef;
+    print "not " unless $@ eq "";
+    print "ok $test # eval unef \n"; $test++;
+}
+

==== //depot/maint-5.8/perl/toke.c#162 (text) ====
Index: perl/toke.c
--- perl/toke.c#161~30096~      2007-02-02 10:03:45.000000000 -0800
+++ perl/toke.c 2007-02-02 12:54:46.000000000 -0800
@@ -603,13 +603,11 @@
     PL_lex_inwhat = 0;
     PL_sublex_info.sub_inwhat = 0;
     PL_linestr = line;
-    if (SvREADONLY(PL_linestr))
-       PL_linestr = sv_2mortal(newSVsv(PL_linestr));
     s = SvPV_const(PL_linestr, len);
-    if (!len || s[len-1] != ';') {
-       if (!(SvFLAGS(PL_linestr) & SVs_TEMP))
-           PL_linestr = sv_2mortal(newSVsv(PL_linestr));
-       sv_catpvs(PL_linestr, "\n;");
+    if (SvREADONLY(PL_linestr) || !len || s[len-1] != ';') {
+       PL_linestr = sv_2mortal(len ? newSVsv(PL_linestr) : newSVpvn(s, 0));
+       if (!len || s[len-1] != ';')
+           sv_catpvs(PL_linestr, "\n;");
     }
     SvTEMP_off(PL_linestr);
     /* PL_linestr needs to survive until end of scope, not just the next
End of Patch.

Reply via email to