[Top][All Lists]

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

Re: GAWK 3.1.3 bug?

From: Stepan Kasal
Subject: Re: GAWK 3.1.3 bug?
Date: Fri, 28 May 2004 11:34:47 +0200
User-agent: Mutt/1.4.1i

   thank you for your bug report.

On Thu, May 27, 2004 at 01:14:47PM -0400, Serge Bohdjalian wrote:
> The following dummy program generates an internal error with Cygwin GAWK 
> 3.1.3:
> function Test(value, array) {
>    return split(value, array, " ");
> }
>    Test(value, array);
>    Test(value, array);
> }
> This program doesn't generate an error with Cygwin GAWK 3.1.2. [...]

I reproduced the problem on my GNU/Linux system.

The patch attached to this mail should fix the bug.

The bug appears only with function parameters which might be either scalars
or arrays.  So the workaroud is to "initialize" the variable before passing
it as parameter, either by a scalar assignment or, if it is an array, by
"touching the array" like saying "arr[1];" or whatever.

The parameter handling is something which got a bit redesigned between 3.1.2
and 3.1.3 and I managed to pass Arnold some buggy code. ;-)
I beleive things are much more stable now, so the next release will have it

So even if you don't want to patch and recompile, you can be safe if you
initialize your variables, which is good practice anyway.

Hope this explanation solves your problem in a satisfactory way,
        Stepan Kasal

Attachment: gawk-3.1.3-make_scalar.patch
Description: Text document

reply via email to

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