diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-27 15:12:01 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-27 15:12:01 +0000 |
commit | 62f274bf15fc9068424c6964230fb6bf80a54c09 (patch) | |
tree | 4a223b1110c6e752bc6a3dc39eb1306daa92a487 /sv.c | |
parent | 3aa35033d09cb8971f2cf3a68ba9828dca8868e7 (diff) | |
download | perl-62f274bf15fc9068424c6964230fb6bf80a54c09.tar.gz |
integrate change#2315 from maint-5.005
p4raw-link: @2315 on //depot/maint-5.005/perl: 7a4920e67d1e2d67a4397a908141c6608866ebb0
p4raw-id: //depot/perl@2327
p4raw-integrated: from //depot/maint-5.005/perl@2326 'ignore' op.c
(@2310..) 'merge in' sv.c (@2174..)
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -3902,14 +3902,19 @@ sv_2cv(SV *sv, HV **st, GV **gvp, I32 lref) SV **sp = &sv; /* Used in tryAMAGICunDEREF macro. */ tryAMAGICunDEREF(to_cv); - cv = (CV*)SvRV(sv); - if (SvTYPE(cv) != SVt_PVCV) + sv = SvRV(sv); + if (SvTYPE(sv) == SVt_PVCV) { + cv = (CV*)sv; + *gvp = Nullgv; + *st = CvSTASH(cv); + return cv; + } + else if(isGV(sv)) + gv = (GV*)sv; + else croak("Not a subroutine reference"); - *gvp = Nullgv; - *st = CvSTASH(cv); - return cv; } - if (isGV(sv)) + else if (isGV(sv)) gv = (GV*)sv; else gv = gv_fetchpv(SvPV(sv, PL_na), lref, SVt_PVCV); |