bug-gawk
[Top][All Lists]
Advanced

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

Re: fatal: internal error: file profile.c, line 1232: unexpected opcode


From: Hermann Peifer
Subject: Re: fatal: internal error: file profile.c, line 1232: unexpected opcode Op_lint_plus
Date: Tue, 3 Oct 2023 14:55:26 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

Your patch works fine on my Macbook, as expected. Hermann

On 03/10/2023 14.48, arnold@skeeve.com wrote:
Indeed, as I predicted. :-)

Have fun,

Arnold

Hermann Peifer <peifer@gmx.eu> wrote:

Thanks for the fix, which I will try in a moment.

I also just noted that the issue is unrelated to the ternary operator as
this code also triggers the fatal error:

  > awk --lint -p 'BEGIN{1+1}'

Hermann

On 03/10/2023 14.29, arnold@skeeve.com wrote:
Hi.

Thanks for the report. This was a pretty easy fix, see the
patch attached to the email.

I will add a test to the test suite and get the change into Git.

The Op_lint_plus is a test for:

        x = "string 1 " + "string 2"        # not string concatenation....

which is only checked when the --lint option is used. Thus a "+"
anywhere in the program probably would have triggered the problem.
But it's unusual to mix --lint and --profile.

Thanks!

Arnold

Hermann Peifer <peifer@gmx.eu> wrote:

Hi again.

AFAICT: the fatal error only happens when profiling/pretty-printing in
combination with using --lint and having a "+" sign in the ternary
expression.

Regards, Hermann

=================

# Fatal error with "1+1" in the ternary expression
   > gawk -o- --lint 'BEGIN{1>2?1+1:2}'
BEGIN {
        gawk: cmd. line:1: fatal: internal error: file profile.c, line 1232:
unexpected opcode Op_lint_plus

# Works as expected with "1-1"
   > gawk -o- --lint 'BEGIN{1>2?1-1:2}'
BEGIN {
        1 > 2 ? 1 - 1 : 2
}

# Works as expected without "--lint"
   > gawk -o- 'BEGIN{1>2?1+1:2}'
BEGIN {
        1 > 2 ? 1 + 1 : 2
}

=================

Configuration Information [Automatically generated, do not change]:
Machine: aarch64
OS: darwin22.6.0
Compiler: gcc
Compilation CFLAGS: -g -O2 -DNDEBUG
uname output: Darwin hal.local 22.6.0 Darwin Kernel Version 22.6.0: Fri
Sep 15 13:41:30 PDT 2023;
root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T8103 arm64
Machine Type: aarch64-apple-darwin22.6.0

Gawk Version: 5.2.60

Attestation 1:
       I have read
https://www.gnu.org/software/gawk/manual/html_node/Bugs.html.
       Yes

Attestation 2:
       I have not modified the sources before building gawk.
       True

Description:/Repeat-By: See above







reply via email to

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