This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
serious bug introduced by G_VOID changes in 5.003_96: scalar
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 17 Oct 1999 20:33:42 +0000 (20:33 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 17 Oct 1999 20:33:42 +0000 (20:33 +0000)
eval"" did not pop stack correctly; C<$a = eval "(1,2)x1">
is one symptom of the problem

p4raw-id: //depot/perl@4401

pp_ctl.c
t/op/eval.t

index 5e45a9c..5f937ba 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3124,6 +3124,7 @@ PP(pp_leaveeval)
            MEXTEND(mark,0);
            *MARK = &PL_sv_undef;
        }
+       SP = MARK;
     }
     else {
        /* in case LEAVE wipes old return values */
index abcb379..ea6caf4 100755 (executable)
@@ -1,6 +1,6 @@
 #!./perl
 
-print "1..37\n";
+print "1..38\n";
 
 eval 'print "ok 1\n";';
 
@@ -176,3 +176,9 @@ $SIG{__DIE__} = sub { eval {1}; die shift };
 eval { die "ok ".$x++,"\n" }; 
 print $@;
 
+# does scalar eval"" pop stack correctly?
+{
+    my $c = eval "(1,2)x10";
+    print $c eq '2222222222' ? "ok $x\n" : "# $c\nnot ok $x\n";
+    $x++;
+}