-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
If an integer constant that is too large or small to fit in an int64_t is specified in the toml file, it will be silently accepted and INT64_MAX or INT64_MIN will be set instead. There appears to be no way for code using toml11 to detect this (and, eg, report to the user that this will not have the expected behaviour).
Steps to reproduce
std::istringstream ss{"int_value = 9223372036854775808"};
auto const value = toml::parse(ss);
assert(value.as_table().at("int_value").as_integer() == 9223372036854775807);
Expected behaviour
toml::parse throws an exception (or maybe the problem is reported directly on the integer toml::value?).
Actual behaviour
toml::parse succeeds, and the assert passes.
Metadata
Metadata
Assignees
Labels
No labels