Open crankycyclops opened 2 years ago
To check for overflow, I just need to do this:
try {
auto value = std::stoi("999999999999999999999999999");
}
catch (const std::out_of_range&) {
...
}
Also, I need to write an isValidUnsigned* family of functions as well. When I do, revsisit my validation of SET_TIMER_PERIOD in instantiator.cpp.
When I validate integers, I should also validate for overflow (make sure the value represented in the string isn't larger than what can actually be stored in the data type.) That means I should have versions of this function that check for 32 as well as 64-bit integers, and both signed and unsigned for each.