summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-24 18:56:57 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-24 19:24:28 -0700
commit73c02f1564c743dc981bd8ea1ce2b967131cbd83 (patch)
tree0904fe8796a823bd2a9e991fd3de58eacb8602b6 /perlio.c
parent1b7228c9af61f2feb164874a11b82557fc988b5f (diff)
downloadperl-73c02f1564c743dc981bd8ea1ce2b967131cbd83.tar.gz
Avoid a double free with CORE->lc
The code for autovivifying coresubs for method calls ended up calling hv_store(stash,name,len,(SV *)gv,0) where gv is already in the stash under that entry. Since hv_store takes ownership of one reference count and decrements that of what it overwrites (which is the same gv in this case), it ends up freeing the gv prematurely. It ended up making that call because S_maybe_add_coresub needs the stash to get its ENAME (which happens when called by gv_fetchmeth), but it also assumed that the presence of the stash meant the gv needed to be stored in it (as is the case with the other caller, gv_fetchpvn_flags). This patch reuses the fullen (full length) parameter as a flag to indicate that that hv_store call should be skipped. These workarounds for the assumptions that newATTRSUB makes are start- ing to make inlining look very attractive....
Diffstat (limited to 'perlio.c')
0 files changed, 0 insertions, 0 deletions