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

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

Thread Previous
From:
Jarkko Hietaniemi
Date:
March 9, 2001 07:01
Subject:
Re: [ID 19990808.001] [PATCH] FETCH triggered on exists()
Message ID:
20010309090141.B22718@chaos.wustl.edu
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++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About