Commit ce4d6717 authored by Michael Jones's avatar Michael Jones
Browse files

[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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment