develooper Front page | perl.perl5.porters | Postings from April 2008

[PATCH] Double magic with '\&$x'

Thread Next
From:
Vincent Pit
Date:
April 1, 2008 01:48
Subject:
[PATCH] Double magic with '\&$x'
Message ID:
34395.147.210.17.175.1207039697.squirrel@147.210.17.175
'\&$x' triggers double get magic when $x is just a scalar because of :
- the SvGETMAGIC in sv_2cv ;
- the SvPV_const in gv_fetchsv.
This patch moves the SvGETMAGIC into the two branches where gv_fetchsv
isn't called. This fixes the problem. Tested ok against 33623.

Actually, get magic also fires when it's not possible to create a sub of
name $x, because we call SvPV when building the croak message. This isn't
fixed by this patch. More generally, I'm wondering if magic actually has
to be triggered when assembling error messages.

Vincent.
Thread Next


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