bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] gawk 4.2.1 critical issue


From: Denis Shirokov
Subject: [bug-gawk] gawk 4.2.1 critical issue
Date: Sun, 25 Mar 2018 14:30:48 +0300

# 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



reply via email to

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