mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
c2c352c6dd
The suspicious code was detected by `gcc-13` as: AI/Nullkiller/Goals/ExecuteHeroChain.cpp: In member function 'virtual void NKAI::Goals::ExecuteHeroChain::accept(NKAI::AIGateway*)': AI/Nullkiller/Goals/ExecuteHeroChain.cpp:130:47: warning: catching polymorphic type 'class NKAI::cannotFulfillGoalException' by value [-Wcatch-value=] 130 | catch(cannotFulfillGoalException) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ AI/Nullkiller/Goals/ExecuteHeroChain.cpp:176:23: warning: catching polymorphic type 'class NKAI::goalFulfilledException' by value [-Wcatch-value=] 176 | catch(goalFulfilledException) | ^~~~~~~~~~~~~~~~~~~~~~ Similar to object passing by value and reference passing polymorphic exceptions by reference likely destroys them when copy-constructed to a base class. Let's catch them by reference. |
||
---|---|---|
.. | ||
BattleAI | ||
EmptyAI | ||
FuzzyLite@9751a751a1 | ||
Nullkiller | ||
StupidAI | ||
VCAI | ||
CMakeLists.txt | ||
FuzzyLite.cbp | ||
GeniusAI.brain |