jacktengg commented on code in PR #68984:
URL: https://github.com/apache/doris/pull/68984#discussion_r4254421072


##########
be/src/util/string_parser.hpp:
##########
@@ -611,7 +612,9 @@ T StringParser::string_to_int_internal(const char* 
__restrict s, int64_t len, in
     switch (*s) {
     case '-':
         negative = true;
-        max_val = StringParser::numeric_limits<T>(false) + 1;
+        // Only signed types have an extra value in their negative range.
+        // Keep the unsigned magnitude limit unchanged to avoid wrapping it to 
zero.
+        max_val += std::numeric_limits<T>::is_signed;

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to