This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t call STORE twice on setpgrp target
authorFather Chrysostomos <sprout@cpan.org>
Tue, 11 Nov 2014 02:39:57 +0000 (18:39 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 11 Nov 2014 02:40:01 +0000 (18:40 -0800)
commit8ec052559a7d6a711ac7ae2497bf6771e249d489
tree2ef52d9f1298ca2c16ea5ee0c235c600589077cf
parentbae8cfc6926f9b04d8adac6a9ee6d563cc18263f
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.)
pp_sys.c
t/op/lex_assign.t