-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
Minor Change
-
ALL
-
v8.0
-
Programmability 2024-06-10, Programmability 2024-06-24, Programmability 2024-07-08
IDL binds integer literals parsed from validator expressions which are greater than 2^31-1 to floating-point expressions rather than integer expressions, even though C++ literals can be greater than 32 bits. This can result in generating validators that perform comparisons between floating points and integers, which maybe imprecise.
e.g. the following field
foo: type: long validator: { gte: 2147483647 }
generates the following validator:
void Ping::validateBlah(IDLParserContext& ctxt, const std::int64_t value) { if (!(value >= 2147483748.0)) { throwComparisonError<std::int64_t>(ctxt, "blah", ">="_sd, value, 2147483748.0); } }