diff options
author | Hugo van der Sanden <hv@crypt.org> | 2000-08-07 17:59:38 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-07 16:12:27 +0000 |
commit | 81689caa70f1ebdcb0b17a51c3e0742ee11ec130 (patch) | |
tree | 9176563e9a9dbc3242f7453a347c35ccf1aa34bf /pp.c | |
parent | 427f4adb1817daf51d5b7762a1ebb87394ca8ac8 (diff) | |
download | perl-81689caa70f1ebdcb0b17a51c3e0742ee11ec130.tar.gz |
Make bless(REF, REF) a fatal error, add bless tests.
Subject: [PATCH bleadperl-6530] bless, REF, and bless(REF, REF)
Message-Id: <200008071559.QAA29541@crypt.compulink.co.uk>
p4raw-id: //depot/perl@6539
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -561,7 +561,13 @@ PP(pp_bless) else { SV *ssv = POPs; STRLEN len; - char *ptr = SvPV(ssv,len); + char *ptr; + + if (ssv && SvGMAGICAL(ssv)) + mg_get(ssv); + if (SvROK(ssv)) + Perl_croak(aTHX_ "Attempt to bless into a reference"); + ptr = SvPV(ssv,len); if (ckWARN(WARN_MISC) && len == 0) Perl_warner(aTHX_ WARN_MISC, "Explicit blessing to '' (assuming package main)"); |