summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.c1
-rw-r--r--t/op/evalbytes.t2
2 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index 2fbf4bd604..93a96783c6 100644
--- a/op.c
+++ b/op.c
@@ -7512,6 +7512,7 @@ Perl_ck_eval(pTHX_ OP *o)
op_getmad(oldo,o,'O');
}
o->op_targ = (PADOFFSET)PL_hints;
+ if (o->op_private & OPpEVAL_BYTES) o->op_targ &= ~HINT_UTF8;
if ((PL_hints & HINT_LOCALIZE_HH) != 0
&& !(o->op_private & OPpEVAL_COPHH) && GvHV(PL_hintgv)) {
/* Store a copy of %^H that pp_entereval can pick up. */
diff --git a/t/op/evalbytes.t b/t/op/evalbytes.t
index 4a60614814..5a03e63e68 100644
--- a/t/op/evalbytes.t
+++ b/t/op/evalbytes.t
@@ -19,7 +19,7 @@ use feature 'evalbytes', 'unicode_eval';
is evalbytes("1+7"), 8, 'evalbytes basic sanity check';
-my $code = 'qq(\xff\xfe)';
+my $code = qq('\xff\xfe');
is evalbytes($code), "\xff\xfe", 'evalbytes on extra-ASCII bytes';
chop((my $upcode = $code) .= chr 256);
is evalbytes($upcode), "\xff\xfe", 'evalbytes on upgraded extra-ASCII';