summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-03 14:20:10 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-03 14:20:10 -0700
commit339c6c60f3062528eca01e318da233bdf2b57ff2 (patch)
treea4e8e5649db91612273de32ac834ff78ddd5377f /pp_hot.c
parent52153b34d3864b1079ae074e5b5e35444ed9f834 (diff)
downloadperl-339c6c60f3062528eca01e318da233bdf2b57ff2.tar.gz
Follow-up to d34a6664
As Nicholas Clark wrote in nntp://nntp.perl.org/20110603192458.GZ2604@plum.flirble.org: > $ valgrind ./perl -Ilib 91880.pl > ==5542== Memcheck, a memory error detector ... > I think that the problem is that this code in S_run_user_filter() > > ENTER_with_name("call_filter_sub"); > SAVEGENERICSV(GvSV(PL_defgv)); > SAVETMPS; > EXTEND(SP, 2); > > > is putting an action on the save stack to write to an address within > the GP of PL_defgv. However, the perl code run about 10 lines later > frees up the GP of PL_defgv, so the scope stack now has a dangling > pointer. 12 lines later at scope exit, the scope stack unwinding > writes to the pointer, and nasal daemons emerge. This commit precedes the SAVEGENERICSV with a call to save_gp, to make sure the GP is not freed (and then a call to GvINTRO_off [set by save_gp], so that subsequent glob assignments are not implicitly localised). This basically emulates what happens with ‘local *_ = \$some_scalar’, but without the extra intermediate RV.
Diffstat (limited to 'pp_hot.c')
0 files changed, 0 insertions, 0 deletions