[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk 4.2.1 critical issue
From: |
Denis Shirokov |
Subject: |
Re: [bug-gawk] gawk 4.2.1 critical issue |
Date: |
Sun, 25 Mar 2018 14:34:40 +0300 |
note: if we are runing same script by gawk 4.1.4 then we will have the
following output
abc(2, 0)
1
abc(1, 1)
1
abc(0, 1)
thnx
2018-03-25 14:30 GMT+03:00, Denis Shirokov <address@hidden>:
> # hello
> #
> # found another critical issue for gawk 4.2.1
> #
> # the following is the gawk 4.2.1 code for reproducing the issue
> #
>
> func abc(c, A, B) {
>
> print "abc(" c ", " length(A) ")"
>
> if ( !c-- )
>
> return
>
> B[""]; print length(B)
>
> return abc(c, B) }
>
> BEGIN {
>
> abc(2)
>
> }
>
> output:
>
>>gawk -f r.gwk
> abc(2, 0)
> 1
> abc(1, 0)
> gawk: r.gwk:9: fatal: attempt to use scalar parameter `B' as an array
>
> # we have user defined function abc() that is calling itself recursively
> # function have two parameters and one local array that is passing
> # as the second parameter while recursive function call.
>
> # please pay attention that local array B isn't present as the
> parameter after function
> # recursive call
>
> # GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.0-p8, GNU MP 5.0.2)
> # Copyright (C) 1989, 1991-2018 Free Software Foundation.
>
> # Win7x64SP1
>
> # with respect
> # Denis Shirokov
>