summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1999-05-08 12:03:45 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1999-05-08 12:03:45 +0000
commit1d8d4d2a360e43d2337420c8e4a3eafc2e301cba (patch)
tree7fd5f46c1e2205d5f2cb2405e8d154b64fda73ca /pp.c
parentd1a52ffb0952ac95d9f26b442ce1e6e48fd984b9 (diff)
downloadperl-1d8d4d2a360e43d2337420c8e4a3eafc2e301cba.tar.gz
Tweaks to open(my $fh,...) stuff
p4raw-id: //depot/perl@3329
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pp.c b/pp.c
index 5a153550e2..e00b8c0910 100644
--- a/pp.c
+++ b/pp.c
@@ -245,16 +245,19 @@ PP(pp_rv2gv)
/* If this is a 'my' scalar and flag is set then vivify
* NI-S 1999/05/07
*/
- if ( (PL_op->op_private & OPpDEREF) &&
- cUNOP->op_first->op_type == OP_PADSV ) {
- STRLEN len;
- SV *padname = *av_fetch(PL_comppad_name, cUNOP->op_first->op_targ, 4);
- char *name = SvPV(padname,len);
+ if (PL_op->op_private & OPpDEREF) {
GV *gv = (GV *) newSV(0);
+ STRLEN len = 0;
+ char *name = "";
+ if (cUNOP->op_first->op_type == OP_PADSV) {
+ SV *padname = *av_fetch(PL_comppad_name, cUNOP->op_first->op_targ, 4);
+ name = SvPV(padname,len);
+ }
gv_init(gv, PL_curcop->cop_stash, name, len, 0);
sv_upgrade(sv, SVt_RV);
SvRV(sv) = (SV *) gv;
SvROK_on(sv);
+ SvSETMAGIC(sv);
goto wasref;
}
if (PL_op->op_flags & OPf_REF ||