From: Simon Cozens Date: Wed, 11 Apr 2001 13:24:35 +0000 (+0100) Subject: prototype("CORE::recv") X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e97e4200e8e581173200042c4e5ee08a8fcdd39;p=p5sagit%2Fp5-mst-13.2.git prototype("CORE::recv") Message-ID: <20010411132435.A26169@netthink.co.uk> p4raw-id: //depot/perl@9685 --- diff --git a/pp.c b/pp.c index 9d96b94..6730f29 100644 --- a/pp.c +++ b/pp.c @@ -448,10 +448,12 @@ PP(pp_prototype) else if (n && str[0] == ';' && seen_question) goto set; /* XXXX system, exec */ if ((oa & (OA_OPTIONAL - 1)) >= OA_AVREF - && (oa & (OA_OPTIONAL - 1)) <= OA_HVREF) { + && (oa & (OA_OPTIONAL - 1)) <= OA_SCALARREF + /* But globs are already references (kinda) */ + && (oa & (OA_OPTIONAL - 1)) != OA_FILEREF + ) { str[n++] = '\\'; } - /* What to do with R ((un)tie, tied, (sys)read, recv)? */ str[n++] = ("?$@@%&*$")[oa & (OA_OPTIONAL - 1)]; oa = oa >> 4; } diff --git a/t/comp/proto.t b/t/comp/proto.t index 5fce526..d0e0acb 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..124\n"; +print "1..125\n"; my $i = 1; @@ -502,3 +502,7 @@ for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) { # Not $$;$;$ print "not " unless prototype "CORE::substr" eq '$$;$$'; print "ok ", $i++, "\n"; + +# recv takes a scalar reference for its second argument +print "not " unless prototype "CORE::recv" eq '*\\$$$'; +print "ok ", $i++, "\n";