From 90a75cfbe533260c0211212bc96e4d5dfa1184e8 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Tue, 3 Sep 2013 19:54:48 -0500 Subject: [PATCH] BC: fix tests 42,43 Attempt to free unreferenced scalar push_begin resetting xcv_gv to NULL is invalid with CvGV_set --- ByteLoader/bytecode.h | 2 +- lib/B/Bytecode.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ByteLoader/bytecode.h b/ByteLoader/bytecode.h index cbd28af77..e3f107418 100644 --- a/ByteLoader/bytecode.h +++ b/ByteLoader/bytecode.h @@ -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); \ diff --git a/lib/B/Bytecode.pm b/lib/B/Bytecode.pm index e0b7174c9..ecf4c8792 100644 --- a/lib/B/Bytecode.pm +++ b/lib/B/Bytecode.pm @@ -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 }