summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-02-07 09:30:47 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-02-07 09:30:47 +0000
commit62c18ce2c158fdc3401f5009417ddcfd1effff4a (patch)
treed2a8ffb909a7e8eee3ed9b0b8d9101e612b93589 /op.c
parentc8984b0bd19897e6e30588055ac0338326f20a34 (diff)
downloadperl-62c18ce2c158fdc3401f5009417ddcfd1effff4a.tar.gz
properly prototype check parenthesized unary ops (e.g. defined(&a,&b))
p4raw-id: //depot/perl@2817
Diffstat (limited to 'op.c')
-rw-r--r--op.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/op.c b/op.c
index 94fbc159ba..8f15a10db3 100644
--- a/op.c
+++ b/op.c
@@ -4642,6 +4642,12 @@ ck_fun(OP *o)
sibl = kid->op_sibling;
switch (oa & 7) {
case OA_SCALAR:
+ /* list seen where single (scalar) arg expected? */
+ if (numargs == 1 && !(oa >> 4)
+ && kid->op_type == OP_LIST && type != OP_SCALAR)
+ {
+ return too_many_arguments(o,PL_op_desc[type]);
+ }
scalar(kid);
break;
case OA_LIST:
@@ -4654,7 +4660,8 @@ ck_fun(OP *o)
break;
case OA_AVREF:
if (kid->op_type == OP_CONST &&
- (kid->op_private & OPpCONST_BARE)) {
+ (kid->op_private & OPpCONST_BARE))
+ {
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newAVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVAV) ));
@@ -4673,7 +4680,8 @@ ck_fun(OP *o)
break;
case OA_HVREF:
if (kid->op_type == OP_CONST &&
- (kid->op_private & OPpCONST_BARE)) {
+ (kid->op_private & OPpCONST_BARE))
+ {
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newHVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVHV) ));
@@ -4704,7 +4712,8 @@ ck_fun(OP *o)
case OA_FILEREF:
if (kid->op_type != OP_GV && kid->op_type != OP_RV2GV) {
if (kid->op_type == OP_CONST &&
- (kid->op_private & OPpCONST_BARE)) {
+ (kid->op_private & OPpCONST_BARE))
+ {
OP *newop = newGVOP(OP_GV, 0,
gv_fetchpv(SvPVx(((SVOP*)kid)->op_sv, n_a), TRUE,
SVt_PVIO) );