diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-07 20:43:14 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-07 20:43:14 +0000 |
commit | 8571fe2faa23f15e20b624e04cae5d59c8ae7242 (patch) | |
tree | ca2613e36bc24814df911da68c7462b79e75bd70 /sv.c | |
parent | fc97af9c8f85fe5d98c1be12130f8f74fe27a7bf (diff) | |
download | perl-8571fe2faa23f15e20b624e04cae5d59c8ae7242.tar.gz |
Ensure PL_last_in_gv doesn't end up pointing to garbage by NULLing it
if the GV it is pointing to gets freed.
p4raw-id: //depot/perl@30868
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -5144,6 +5144,11 @@ Perl_sv_clear(pTHX_ register SV *sv) if (!SvVALID(sv) && GvSTASH(sv)) sv_del_backref((SV*)GvSTASH(sv), sv); } + /* FIXME. There are probably more unreferenced pointers to SVs in the + interpreter struct that we should check and tidy in a similar + fashion to this: */ + if ((GV*)sv == PL_last_in_gv) + PL_last_in_gv = NULL; case SVt_PVMG: case SVt_PVNV: case SVt_PVIV: |