Ticket #48849

gcc-14: city_from_wonder() out-of-bounds array subscript

Eröffnet am: 2023-10-16 03:50 Letztes Update: 2023-10-18 00:33

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
1

Details

gcc-14 development version, S3_1:

../../../src/common/improvement.c: In function 'city_from_wonder':
../../../src/common/improvement.c:874:33: error: array subscript -1 is below array bounds of 'const int[200]' [-Werror=array-bounds=]
  874 |   int city_id = pplayer->wonders[improvement_index(pimprove)];
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../src/common/game.h:35,
                 from ../../../src/common/improvement.c:27:
../../../src/common/player.h:301:7: note: while referencing 'wonders'
  301 |   int wonders[B_LAST];              /* contains city id's, WONDER_NOT_BUILT,

Ticket-Verlauf (3/4 Historien)

2023-10-16 03:50 Aktualisiert von: cazfi
  • New Ticket "gcc-14: city_from_wonder() out-of-bounds array subscript" created
2023-10-16 03:59 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
  • Meilenstein Update from (Keine) to 3.0.9 (closed)
Kommentar

Patch for all branches, including S2_6, attached.

2023-10-18 00:33 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden