mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-20 12:44:59 -07:00
Make big_int_from_string return an error if not an integer.
This commit is contained in:
+5
-1
@@ -177,7 +177,11 @@ ExactValue exact_value_typeid(Type *type) {
|
||||
|
||||
ExactValue exact_value_integer_from_string(String const &string) {
|
||||
ExactValue result = {ExactValue_Integer};
|
||||
big_int_from_string(&result.value_integer, string);
|
||||
bool success;
|
||||
big_int_from_string(&result.value_integer, string, &success);
|
||||
if (!success) {
|
||||
result = {ExactValue_Invalid};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user