summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2001-11-02 17:28:58 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-02 14:58:13 +0000
commit6a10712c3870da25ad77d029fde175653025d424 (patch)
tree9102a3f7bf4f2273e21ca6dad365361141690c30 /op.c
parent4436da5d6a649d9802a10023e54978ba359e1a7d (diff)
downloadperl-6a10712c3870da25ad77d029fde175653025d424.tar.gz
Re: [ID 20011101.069] \stat('.') gives "Attempt to free unreferenced scalar"
Message-ID: <15330.40858.629851.468818@ix.netsoft.ro> p4raw-id: //depot/perl@12811
Diffstat (limited to 'op.c')
-rw-r--r--op.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/op.c b/op.c
index 4740afd1f1..4b00e0f30e 100644
--- a/op.c
+++ b/op.c
@@ -1670,19 +1670,22 @@ Perl_mod(pTHX_ OP *o, I32 type)
goto nomod;
break; /* mod()ing was handled by ck_return() */
}
- if (type != OP_LEAVESUBLV)
- o->op_flags |= OPf_MOD;
-
- if (type == OP_AASSIGN || type == OP_SASSIGN)
- o->op_flags |= OPf_SPECIAL|OPf_REF;
- else if (!type) {
- o->op_private |= OPpLVAL_INTRO;
- o->op_flags &= ~OPf_SPECIAL;
- PL_hints |= HINT_BLOCK_SCOPE;
+ if (type != OP_REFGEN ||
+ PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)) {
+ if (type != OP_LEAVESUBLV)
+ o->op_flags |= OPf_MOD;
+
+ if (type == OP_AASSIGN || type == OP_SASSIGN)
+ o->op_flags |= OPf_SPECIAL|OPf_REF;
+ else if (!type) {
+ o->op_private |= OPpLVAL_INTRO;
+ o->op_flags &= ~OPf_SPECIAL;
+ PL_hints |= HINT_BLOCK_SCOPE;
+ }
+ else if (type != OP_GREPSTART && type != OP_ENTERSUB
+ && type != OP_LEAVESUBLV)
+ o->op_flags |= OPf_REF;
}
- else if (type != OP_GREPSTART && type != OP_ENTERSUB
- && type != OP_LEAVESUBLV)
- o->op_flags |= OPf_REF;
return o;
}