[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite"
From: |
Aharon Robbins |
Subject: |
Re: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite" |
Date: |
Tue, 15 Apr 2003 08:42:11 +0300 |
> Date: Mon, 14 Apr 2003 20:36:34 -0700 (PDT)
> From: Olatunji Oluwabukunmi Ruwase <address@hidden>
> To: address@hidden
> Subject: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite"
>
> Hello,
> I am working on a bounds checking patch to gcc.
This is good news. Are you aware that Greg McGary did similar work?
> While testing my patch on
> gawk-3.1.0 using the testsuite my compiler halts with an error message
> that indicating the attempt to use a null pointer in an arithmetic
> operation. In investigating the problem I ddecided to use only one of the
> test programs "basic" using the following command line
>
> address@hidden gawk-3.1.0]$ cd test
> address@hidden test]$ make basic
> io.c:2116:Bounds error: NULL or ILLEGAL pointer used in pointer
> arithmetic.
> io.c:2116: Pointer value: NULL
> make: *** [addcomma] Error 134
>
> I verified this error message by modifying io.c (using the attached diff),
> and found out that the variable iop->buf is used in pointer arithmetic
> even when it is NULL. This situation exists even when compiling with the
> default gcc compiler.
> So I will like to find out if this is a bug or it is some deliberate non
> standard hack.
>
> Thank you
>
> tunji
The code's use was deliberate. It works since the pointer that's derived
is never actually used in practice to dereference memory; just for a less
than comparison.
As Paul Eggert mentioned, that code is out of date. gawk 3.1.2 is the current
release, for which I rewrote the get_a_record() function (splitting it into
three separate ones). I'd be interested to see your results on the current
code base.
Thanks,
Arnold
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Re : "Pointer arithmetic using Null pointer in gawk-3.1.0 testsuite",
Aharon Robbins <=