diff options
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | t/op/negate.t | 9 |
2 files changed, 9 insertions, 2 deletions
@@ -3206,7 +3206,7 @@ S_op_integerize(pTHX_ OP *o) if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER)) { dVAR; - o->op_ppaddr = PL_ppaddr[type = ++(o->op_type)]; + o->op_ppaddr = PL_ppaddr[++(o->op_type)]; } if (type == OP_NEGATE) diff --git a/t/op/negate.t b/t/op/negate.t index 033beb5c1f..3b02e35f20 100644 --- a/t/op/negate.t +++ b/t/op/negate.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 45; +plan tests => 46; # Some of these will cause warnings if left on. Here we're checking the # functionality, not the warnings. @@ -102,3 +102,10 @@ is -$t, -97656250000000000, 'magic str+int dualvar'; is(-$au, -$a, 'utf8 flag makes no difference for string negation'); is -"\x{100}", 0, '-(non-ASCII) is equivalent to -(punct)'; } + +# [perl #120288] use integer should not stop barewords from being quoted +{ + use strict; + use integer; + is eval "return -a"||$@, "-a", '-bareword under strict+integer'; +} |