X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=748888704c93069a5a85ef91e76a8fe457b63ad3;hb=2e5b50041f3643ca27385b211da60add40857ec8;hp=f1faf42f071bacc98b6dbe590300481410f77e7d;hpb=9de654f174a7c7ca88031e2ac4a33add560d0c8c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index f1faf42..7488887 100644 --- a/op.c +++ b/op.c @@ -399,14 +399,6 @@ Perl_allocmy(pTHX_ const char *const name) /* check for duplicate declaration */ pad_check_dup(name, is_our, (PL_curstash ? PL_curstash : PL_defstash)); - if (PL_parser->in_my_stash && *name != '$') { - yyerror(Perl_form(aTHX_ - "Can't declare class for non-scalar %s in \"%s\"", - name, - is_our ? "our" - : PL_parser->in_my == KEY_state ? "state" : "my")); - } - /* allocate a spare slot and store the name in that slot */ off = pad_add_name(name, @@ -4333,7 +4325,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right) ((LISTOP*)right)->op_last->op_type == OP_CONST) { SV *sv = ((SVOP*)((LISTOP*)right)->op_last)->op_sv; - if (SvIVX(sv) == 0) + if (SvIOK(sv) && SvIVX(sv) == 0) sv_setiv(sv, PL_modcount+1); } } @@ -5224,6 +5216,8 @@ S_looks_like_bool(pTHX_ const OP *o) case OP_DEFINED: case OP_EXISTS: case OP_MATCH: case OP_EOF: + case OP_FLOP: + return TRUE; case OP_CONST: @@ -5234,11 +5228,6 @@ S_looks_like_bool(pTHX_ const OP *o) return TRUE; else return FALSE; - - case OP_FLOP: - /* Detect "..." flip-flop operator */ - if (cUNOPo->op_first->op_flags & OPf_SPECIAL) - return TRUE; /* FALL THROUGH */ default: