[libc][NFC] make atoi undefined cases match std
The standard describes atoi as: "equivalent to atoi: (int)strtol(nptr, (char **)NULL, 10)" Previously, our behavior was slightly different on numbers larger than INT_MAX, but this patch changes it to just do the cast instead. Both of these are valid since the standard says "If the value of the result cannot be represented, the behavior is undefined." But matching existing behavior makes differential fuzzing easier. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D140350
parent
407b1882
Please register or sign in to comment