develooper Front page | perl.perl5.porters | Postings from March 2001

Re: [ID 19990808.001] [PATCH] FETCH triggered on exists()

Thread Previous
Jarkko Hietaniemi
March 9, 2001 07:01
Re: [ID 19990808.001] [PATCH] FETCH triggered on exists()
Message ID:
On Fri, Mar 09, 2001 at 03:30:20AM -0500, Robert Spier wrote:
> What you're saying makes sense.  
> So, I'll start following it down the other path:
> A little bit of GDB walking and here's what I see:
> FETCH is being called inside the
> hv.c:934	    return SvTRUE(sv);
> SvTRUE is a scary macro which calls sv_2bool
> sv_2bool on a magical variable calls mg_get()
> and mg_get calls the get entry in the vtable for the magic, which for
> a hash is  Perl_magic_getpack, which does the FETCH method
> invocation.  *kaboom*
> I think the problem is that the sv passed to
>      magic_existspack(sv, mg_find(sv, 'p'));
> is Magical, because it'a copy of the magical HV.
> I think the patch below may (actually) solve this problem (instead of
> documenting it firmly in place).  It creates a new SV to hold the
> return value from magic_existspack, instead of using the magical
> pointer.
> All tests in the test suite pass for me, (except for op/qu.t, which is 

Thanks, applied.

rm t/op/qu.t

$jhi++; #
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About