-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Service Arch
-
ALL
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); } }