任务单 #47959

dai_select_tech() clang analyzer warning about garbage value

开放日期: 2023-04-28 05:43 最后更新: 2023-05-09 18:00

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
2

Details

../../../../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.

任务单历史 (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 Fixed

编辑

Please login to add comment to this ticket » 登录名