Fix #12109 Crash in calculate.h#5587
Conversation
|
I can't reproduce the FP locally for some reason, although |
See also https://trac.cppcheck.net/ticket/11913. |
I also cannot reproduce it. I really need to make it easier to run the selfcheck. I am considering making it a build target after another round of cleanups so you can easily run it locally and to get rid of the duplicated code in the CI. |
| return wrap(x * y); | ||
| case '/': | ||
| if (isZero(y)) { | ||
| if (isZero(y) || (std::is_integral<T>::value && std::is_signed<T>::value && isEqual(y, T(-1)) && isEqual(x, std::numeric_limits<T>::min()))) { // cppcheck-suppress knownConditionTrueFalse |
There was a problem hiding this comment.
Write std::is_integral<T>{} and std::is_signed<T>{} instead of ::value.
There was a problem hiding this comment.
I would have used std::is_integral_v<T> if it was available, but yours works in C++11 and also "fixes" the FP 👍
No description provided.