This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
much simpler fix to typecheck read/sysread/recv, as suggested by
authorGurusamy Sarathy <gsar@cpan.org>
Mon, 6 Jul 1998 22:20:29 +0000 (22:20 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Mon, 6 Jul 1998 22:20:29 +0000 (22:20 +0000)
Stephen McCamant

p4raw-id: //depot/perl@1346

op.c

diff --git a/op.c b/op.c
index b567c9a..ab7a056 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1304,6 +1304,9 @@ scalar_mod_type(OP *o, I32 type)
     case OP_CONCAT:
     case OP_SUBST:
     case OP_TRANS:
+    case OP_READ:
+    case OP_SYSREAD:
+    case OP_RECV:
     case OP_ANDASSIGN: /* may work later */
     case OP_ORASSIGN:  /* may work later */
        return TRUE;
@@ -4974,7 +4977,7 @@ peep(register OP *o)
 
        case OP_PADAV:
            if (o->op_next->op_type == OP_RV2AV
-               && (o->op_next->op_flags && OPf_REF))
+               && (o->op_next->op_flags & OPf_REF))
            {
                null(o->op_next);
                o->op_next = o->op_next->op_next;
@@ -4983,7 +4986,7 @@ peep(register OP *o)
        
        case OP_PADHV:
            if (o->op_next->op_type == OP_RV2HV
-               && (o->op_next->op_flags && OPf_REF))
+               && (o->op_next->op_flags & OPf_REF))
            {
                null(o->op_next);
                o->op_next = o->op_next->op_next;