Seen on S3_0: clang analyzer warns about pcity->anarchy in dai_spend_gold() to potentially be a NULL dereference.
I don't think it can ever be, as then also the bestchoice.value would be left to value 0, which causes loop to break before reaching that pcity->anarchy.
However, the coding style around there isn't really good considering that choice.want is a floating point number. It makes sense to refactor the code a bit, and presumably to get rid of the clang analyzer warning in the process.
Seen on S3_0: clang analyzer warns about pcity->anarchy in dai_spend_gold() to potentially be a NULL dereference.
I don't think it can ever be, as then also the bestchoice.value would be left to value 0, which causes loop to break before reaching that pcity->anarchy.
However, the coding style around there isn't really good considering that choice.want is a floating point number. It makes sense to refactor the code a bit, and presumably to get rid of the clang analyzer warning in the process.