diff options
author | Radu Greab <radu@netsoft.ro> | 2001-11-02 17:28:58 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-02 14:58:13 +0000 |
commit | 58d9517576e61e077f66c327ee4c44c5d9bbf1a7 (patch) | |
tree | 9102a3f7bf4f2273e21ca6dad365361141690c30 | |
parent | fee3faeaf0fd7f75acc0a8658e8dffa83c1aba1e (diff) | |
download | perl-58d9517576e61e077f66c327ee4c44c5d9bbf1a7.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
-rw-r--r-- | op.c | 27 | ||||
-rwxr-xr-x | t/op/stat.t | 6 |
2 files changed, 20 insertions, 13 deletions
@@ -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; } diff --git a/t/op/stat.t b/t/op/stat.t index dc47ef3885..8d0ca19bc0 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -9,7 +9,7 @@ BEGIN { use Config; -print "1..58\n"; +print "1..59\n"; $Is_MSWin32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; @@ -281,3 +281,7 @@ if (-f) {print "ok 57\n";} else {print "not ok 57\n";} if (-f()) {print "ok 58\n";} else {print "not ok 58\n";} unlink 'Op.stat.tmp' or print "# unlink failed: $!\n"; + +# bug id 20011101.069 +my @r = \stat("."); +if (@r == 13) { print "ok 59\n" } else { print "not ok 59\n" } |