bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Special Comparisons: uninitialized array index


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Special Comparisons: uninitialized array index
Date: Mon, 7 Aug 2017 14:03:26 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Aug 07, 2017 at 11:59:30AM -0600, address@hidden wrote:
> "Andrew J. Schorr" <address@hidden> wrote:
> 
> > Perhaps the patch should be:
> >
> > --- a/str_array.c
> > +++ b/str_array.c
> > @@ -165,7 +165,7 @@ str_lookup(NODE *symbol, NODE *subs)
> >          * "Array indices are always strings."
> >          * ....
> >          */
> > -       if (subs->stfmt != STFMT_UNUSED) {
> > +       if (subs->stfmt != STFMT_UNUSED || subs == Nnull_string || 
> > (subs->flags & NULL_FIELD)) {
> >                 /* The string was generated using CONVFMT. */
> >                 NODE *tmp;
> 
> That's the right one.
...
> I will get this fix into master along with the test program.  With
> this change typeof (correctly) reports string.

Also -- the comment inside the "if" block should probably be updated.
And there should probably be 2 test cases: one with an unassigned variable,
and another with an unassigned field.

Thanks,
Andy



reply via email to

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