diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-21 10:57:34 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-25 14:22:20 -0700 |
commit | c2f922f11b8978a4eea0e0d28626dd3c1f6eaba7 (patch) | |
tree | 3fd3855c5f37c62bc93923780a8f41c49486cb25 /pp.c | |
parent | f6a1686942506c3f2a041ff124bdc34d22ed5f26 (diff) | |
download | perl-c2f922f11b8978a4eea0e0d28626dd3c1f6eaba7.tar.gz |
&CORE::bless()
This commit allows &CORE::bless to be called through references and
via ampersand syntax. pp_bless is modified to take into account the
nulls pushed on to the stack in pp_coreargs, since pp_coreargs has no
other way to tell bless how many arguments it’s actually getting.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -590,13 +590,15 @@ PP(pp_bless) HV *stash; if (MAXARG == 1) + curstash: stash = CopSTASH(PL_curcop); else { SV * const ssv = POPs; STRLEN len; const char *ptr; - if (ssv && !SvGMAGICAL(ssv) && !SvAMAGIC(ssv) && SvROK(ssv)) + if (!ssv) goto curstash; + if (!SvGMAGICAL(ssv) && !SvAMAGIC(ssv) && SvROK(ssv)) Perl_croak(aTHX_ "Attempt to bless into a reference"); ptr = SvPV_const(ssv,len); if (len == 0) |