zclllyybb commented on code in PR #18903:
URL: https://github.com/apache/doris/pull/18903#discussion_r1174307399


##########
be/src/util/string_parser.hpp:
##########
@@ -253,7 +253,7 @@ T StringParser::string_to_int_internal(const char* s, int 
len, ParseResult* resu
     switch (*s) {
     case '-':
         negative = true;
-        max_val = StringParser::numeric_limits<T>(false) + 1;
+        max_val = StringParser::numeric_limits<T>(false) + UnsignedT(1);

Review Comment:
   maybe we should split `max_val` & `min_val` usage? the UB occurs when T is a 
signed number. in that case, this is always UB.



-- 
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