[freeciv-ai] Re: [Freeciv-Dev] (PR#2634) ai_military_attack() bug#2
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 23 Dec 2002, Per I. Mathisen via RT wrote:
> @@ -1996,6 +2028,9 @@
> UNIT_LOG(LOG_DEBUG, punit, "mil att bash -> %d, %d", dest_x, dest_y);
> ai_unit_attack(punit, dest_x, dest_y);
> }
> + if (!(punit = find_unit_by_id(id))) {
> + return; /* we died */
> + }
> } /* while */
> } else {
> /* FIXME: This happens a bit too often! */
> @@ -2004,10 +2039,8 @@
> ct = 0;
> }
>
> - if (!(punit = find_unit_by_id(id))) {
> - return; /* we died */
> - }
> ct--; /* infinite loops from railroads must be stopped */
>
> It is possible to attack and die, and still do another loop in
> ai_military_attack, leading to a core dump. If we add the first check, we
This looks quite critical to me. Why haven't I seen any coredumps yet?
> can remove the latter. This should be fixed for S1_14 as well as head, but
> for S1_14 we can keep the latter check as well to be absolutely sure.
So beta4 ? ;)
G.
- [freeciv-ai] Re: [Freeciv-Dev] (PR#2634) ai_military_attack() bug#2,
Gregory Berkolaiko via RT <=
|
|