In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/2c217c4598fa36f236d5085b4d73b7282b80beb1?hp=f9e95907d516e72aa3d1664d0723718e812957e6>
- Log ----------------------------------------------------------------- commit 2c217c4598fa36f236d5085b4d73b7282b80beb1 Author: Father Chrysostomos <[email protected]> Date: Mon Nov 10 18:43:29 2014 -0800 Suppress warning from lex_assign.t M t/op/lex_assign.t commit 8ec052559a7d6a711ac7ae2497bf6771e249d489 Author: Father Chrysostomos <[email protected]> Date: Mon Nov 10 18:39:57 2014 -0800 Donât call STORE twice on setpgrp target If the target is a lexical variable (as happens with â$lex = setpgrpâ, in which the assignment is optimised away), then doing set-magic mul- tiple times has an observable effect. This was only happening when it was called with no arguments. This double STORE goes back to 1f200948c4c. 1f200948c4c was just meant to fix a stack bug, but extending the stack when necessary, but it was also push TARG and setting it to -1, only for it to be over- written shortly. (Also, it didnât fully fix the stack bugs. See 88d6953212e.) M pp_sys.c M t/op/lex_assign.t commit bae8cfc6926f9b04d8adac6a9ee6d563cc18263f Author: Father Chrysostomos <[email protected]> Date: Mon Nov 10 18:22:43 2014 -0800 Donât treat setpgrp($nonzero) as setpgrp(1) This was broken inadvertently by 92f2ac5f (5.15.3). I really have no idea how to test this. I only confirmed the bug and its fix via a temporary warn statement in pp_setpgrp (obviously not included in this commit). M pp_sys.c ----------------------------------------------------------------------- Summary of changes: pp_sys.c | 5 +++-- t/op/lex_assign.t | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pp_sys.c b/pp_sys.c index 16c2d60..831bf26 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4449,10 +4449,11 @@ PP(pp_setpgrp) Pid_t pgrp; Pid_t pid; pgrp = MAXARG == 2 && (TOPs||POPs) ? POPi : 0; - if (MAXARG > 0) pid = TOPs && TOPi; + if (MAXARG > 0) pid = TOPs ? TOPi : 0; else { pid = 0; - XPUSHi(-1); + EXTEND(SP,1); + SP++; } TAINT_PROPER("setpgrp"); diff --git a/t/op/lex_assign.t b/t/op/lex_assign.t index ff027d4..1c6e9f3 100644 --- a/t/op/lex_assign.t +++ b/t/op/lex_assign.t @@ -130,6 +130,7 @@ EOE $op =~ s/==.*//; $sc = 0; + local $SIG{__WARN__} = \&wrn; eval "\$m = $op"; is $sc, 1, "STORE count for $comment"; } @@ -320,7 +321,7 @@ system "$runme -e 0" # system skip(VMS) '???' # kill getppid # getppid getpgrp # getpgrp -'???' # setpgrp +setpgrp # setpgrp getpriority $$, $$ # getpriority '???' # setpriority time # time -- Perl5 Master Repository
