mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +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. |
||
---|---|---|
.. | ||
Analyzers | ||
Behaviors | ||
Engine | ||
Goals | ||
Markers | ||
Pathfinding | ||
AIGateway.cpp | ||
AIGateway.h | ||
AIUtility.cpp | ||
AIUtility.h | ||
CMakeLists.txt | ||
main.cpp | ||
StdInc.cpp | ||
StdInc.h |