We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c83f4d commit 370133eCopy full SHA for 370133e
include/behaviortree_cpp/scripting/operators.hpp
@@ -129,6 +129,11 @@ struct ExprUnaryArithmetic : ExprBase
129
case negate:
130
return Any(-rv);
131
case complement:
132
+ if(rv > static_cast<double>(std::numeric_limits<int64_t>::max()) ||
133
+ rv < static_cast<double>(std::numeric_limits<int64_t>::min()))
134
+ {
135
+ throw RuntimeError("Number out of range for bitwise operation");
136
+ }
137
return Any(static_cast<double>(~static_cast<int64_t>(rv)));
138
case logical_not:
139
return Any(static_cast<double>(!static_cast<bool>(rv)));
0 commit comments