summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-05 16:29:39 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-05 16:29:39 +0000
commiteac055e92e0ec1f73bd09a2bf54dc6b090cbdb78 (patch)
tree009752bdc7fdc2241f92fe4d9ee542c089b244c0 /op.c
parent59c10aa22854831f97f41f8f8237b4d9b2426b0f (diff)
downloadperl-eac055e92e0ec1f73bd09a2bf54dc6b090cbdb78.tar.gz
allow C<-foo> under C<use integer> (behavior of C<-$string>
is unchanged still) p4raw-id: //depot/perl@3588
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/op.c b/op.c
index f0cd15f433..25b17dc1e1 100644
--- a/op.c
+++ b/op.c
@@ -1833,8 +1833,14 @@ Perl_fold_constants(pTHX_ register OP *o)
if (PL_opargs[type] & OA_TARGET)
o->op_targ = pad_alloc(type, SVs_PADTMP);
- if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER))
+ /* integerize op, unless it happens to be C<-foo>.
+ * XXX should pp_i_negate() do magic string negation instead? */
+ if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER)
+ && !(type == OP_NEGATE && cUNOPo->op_first->op_type == OP_CONST
+ && (cUNOPo->op_first->op_private & OPpCONST_BARE)))
+ {
o->op_ppaddr = PL_ppaddr[type = ++(o->op_type)];
+ }
if (!(PL_opargs[type] & OA_FOLDCONST))
goto nope;