Ticket #47959

dai_select_tech() clang analyzer warning about garbage value

오픈 날짜: 2023-04-28 05:43 마지막 업데이트: 2023-05-09 18:00

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
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.

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 (None) to cazfi
  • Resolution Update from None to Accepted
2023-05-09 18:00 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login