aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--awkgram.c2
-rw-r--r--awkgram.y2
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3255d8e8..9d292725 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y: For '!' optimization on a string constant, don't
+ apply the optimization if it's a translatable string. Thanks
+ to Jeremy Feusi <jeremy@feusi.co> for the report.
+
2017-11-25 Andrew J. Schorr <aschorr@telemetry-investments.com>
* debug.c (do_set_var): As in interpret.h (Op_store_field), we should
diff --git a/awkgram.c b/awkgram.c
index 1700a836..3bc19645 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -3817,7 +3817,7 @@ regular_print:
} else {
if (do_optimize && (yyvsp[0])->nexti == (yyvsp[0])->lasti
&& (yyvsp[0])->nexti->opcode == Op_push_i
- && ((yyvsp[0])->nexti->memory->flags & (MPFN|MPZN)) == 0
+ && ((yyvsp[0])->nexti->memory->flags & (MPFN|MPZN|INTLSTR)) == 0
) {
NODE *n = (yyvsp[0])->nexti->memory;
if ((n->flags & STRING) != 0) {
diff --git a/awkgram.y b/awkgram.y
index 9f351436..bbc598dd 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1717,7 +1717,7 @@ non_post_simp_exp
} else {
if (do_optimize && $2->nexti == $2->lasti
&& $2->nexti->opcode == Op_push_i
- && ($2->nexti->memory->flags & (MPFN|MPZN)) == 0
+ && ($2->nexti->memory->flags & (MPFN|MPZN|INTLSTR)) == 0
) {
NODE *n = $2->nexti->memory;
if ((n->flags & STRING) != 0) {