Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7216) take again client crash
Home

[Freeciv-Dev] Re: (PR#7216) take again client crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7216) take again client crash
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Sat, 10 Jan 2004 13:21:01 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7216 >

On Sat, Jan 10, 2004 at 10:00:52AM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7216 >
> 
> 
> >> > I also propose a patch like this or similar:
> >> >
> >> >  ***************************************************************/
> >> >  struct tile *map_get_tile(int x, int y)
> >> >  {
> >> > +  assert(map.tiles != NULL);
> >> >    return MAP_TILE(x, y);
> >> >  }
> >>
> >> absolutely not. Do you know how many times map_get_tile gets called?
> >
> > It is one test on a value already loaded into a register.
> 
> But it is useless since MAP_TILE will result in a segfault anyway.

MAP_TILE won't segfault. But the caller of map_get_tile will get an
invalid pointer back which is not NULL but the map index. Because it
is not NULL the connection to map.tiles==NULL is not obvious.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  The Software is not designed or licensed for use in on-line control
  equipment in hazardous environments, such as operation of nuclear
  facilities, aircraft navigation or control, or direct life support
  machines. 
    -- Java Compiler Compiler Download and License Agreement




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