bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Misoptimisation: _"A" "B" to _"AB"


From: Harald van Dijk
Subject: [bug-gawk] Misoptimisation: _"A" "B" to _"AB"
Date: Sat, 21 Oct 2017 16:14:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Hi all,

Trying the new gawk 4.2.0 where optimisations are enabled by default, I spot a test failure in the gettext test suite, which can be reduced simply to

    { print _"A" "B" }

When optimisations are disabled, this translates "A", and adds "B" to it.

When optimisations are enabled, this first adds "B" to "A", and then translates "AB". Which is likely to fail.

The previous version of gawk behaved the same way, but because optimisations were disabled by default, it didn't really come up.

awkgram.y contains code to disable early concatenation if either operand is a number. I believe this should be extended to also disable early concatenation if either operand is translatable.

Cheers,
Harald van Dijk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]