aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-12-10 19:04:10 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-12-10 19:04:10 +0200
commitd73659dcfd3a76103bf3772b075cc74d3e259fee (patch)
tree10f8369490eb46e96f54818c28134911a9f6de3f
parent3b8275d87abeb26a9989cb02fc85f62006ab70cd (diff)
downloadegawk-d73659dcfd3a76103bf3772b075cc74d3e259fee.tar.gz
egawk-d73659dcfd3a76103bf3772b075cc74d3e259fee.tar.bz2
egawk-d73659dcfd3a76103bf3772b075cc74d3e259fee.zip
Don't optimize !_"...".
-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) {