待辦事項 #47959

dai_select_tech() clang analyzer warning about garbage value

啟用日期: 2023-04-28 05:43 最後更新: 2023-05-09 18:00

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
2

細節

../../../../src/ai/default/aitech.c:173:26: warning: The left operand of '>' is a garbage value [core.UndefinedBinaryOperatorResult]
      if (goal_values[i] > goal_values[newgoal]

This is likely to be false positive. Analyzer just doesn't know that on each iteration valid_advance_by_number() will filter exactly same techs out, i.e., the same indices are initialized and used.

This ticket is about fixing the clang analyzer warning. There's space for refactoring, but will open separate ticket about that.

Ticket History (3/6 Histories)

2023-04-28 05:43 Updated by: cazfi
  • New Ticket "dai_select_tech() clang analyzer warning about garbage value" created
2023-04-28 05:45 Updated by: cazfi
評語

Reply To cazfi

There's space for refactoring, but will open separate ticket about that.

-> #47960

2023-05-07 23:06 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
2023-05-09 18:00 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入