mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
some fix
This commit is contained in:
parent
ae3a27c91d
commit
17805032da
@ -558,7 +558,7 @@ IntParsingResult parse_uint(std::string_view text, i64* out, int base) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const std::string_view INT64_MAX_S = "9223372036854775807";
|
const std::string_view INT64_MAX_S = "9223372036854775807";
|
||||||
if(text.length() >= INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
if(text.length() > INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
||||||
return IntParsingResult::Success;
|
return IntParsingResult::Success;
|
||||||
} else if(base == 2) {
|
} else if(base == 2) {
|
||||||
// 2-base 0b101010
|
// 2-base 0b101010
|
||||||
@ -572,7 +572,7 @@ IntParsingResult parse_uint(std::string_view text, i64* out, int base) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const std::string_view INT64_MAX_S = "111111111111111111111111111111111111111111111111111111111111111";
|
const std::string_view INT64_MAX_S = "111111111111111111111111111111111111111111111111111111111111111";
|
||||||
if(text.length() >= INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
if(text.length() > INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
||||||
return IntParsingResult::Success;
|
return IntParsingResult::Success;
|
||||||
} else if(base == 8) {
|
} else if(base == 8) {
|
||||||
// 8-base 0o123
|
// 8-base 0o123
|
||||||
@ -586,7 +586,7 @@ IntParsingResult parse_uint(std::string_view text, i64* out, int base) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const std::string_view INT64_MAX_S = "777777777777777777777";
|
const std::string_view INT64_MAX_S = "777777777777777777777";
|
||||||
if(text.length() >= INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
if(text.length() > INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
||||||
return IntParsingResult::Success;
|
return IntParsingResult::Success;
|
||||||
} else if(base == 16) {
|
} else if(base == 16) {
|
||||||
// 16-base 0x123
|
// 16-base 0x123
|
||||||
@ -604,7 +604,7 @@ IntParsingResult parse_uint(std::string_view text, i64* out, int base) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const std::string_view INT64_MAX_S = "7fffffffffffffff";
|
const std::string_view INT64_MAX_S = "7fffffffffffffff";
|
||||||
if(text.length() >= INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
if(text.length() > INT64_MAX_S.length()) return IntParsingResult::Overflow;
|
||||||
return IntParsingResult::Success;
|
return IntParsingResult::Success;
|
||||||
}
|
}
|
||||||
return IntParsingResult::Failure;
|
return IntParsingResult::Failure;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user