Skip to content

Commit

Permalink
BC: fix tests 42,43 Attempt to free unreferenced scalar
Browse files Browse the repository at this point in the history
push_begin resetting xcv_gv to NULL is invalid with CvGV_set
  • Loading branch information
Reini Urban committed Sep 4, 2013
1 parent 2bcf0b8 commit 90a75cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ByteLoader/bytecode.h
Expand Up @@ -641,7 +641,7 @@ static int bget_swab = 0;
if (!PL_beginav) \
PL_beginav = newAV(); \
av_push(PL_beginav, (SV*)cv); \
CvGV_set((CV*)cv, NULL); /* cv has been hijacked */ \
SvANY((CV*)cv)->xcv_gv_u.xcv_gv = 0; /* cv has been hijacked */\
call_list(oldscope, PL_beginav); \
PL_curcop = &PL_compiling; \
CopHINTS_set(&PL_compiling, (U8)PL_HINTS_PRIVATE); \
Expand Down
2 changes: 1 addition & 1 deletion lib/B/Bytecode.pm
Expand Up @@ -662,7 +662,7 @@ sub B::CV::bsave {
my $cvflags = $cv->CvFLAGS;
$cvflags |= 0x400 if $] >= 5.013 and !$cv->MAGIC;
asm "xcv_flags", $cvflags;
asm "xcv_gv", $gvix if $cv->GV;
asm "xcv_gv", $gvix if $cv->GV and ref($cv->GV) ne 'B::SPECIAL';
#TODO 5.18.1 set name_hek for lexsub
asm "xcv_file", pvix $cv->FILE if $cv->FILE; # XXX AD
}
Expand Down

0 comments on commit 90a75cf

Please sign in to comment.