I guess this code comes from the upstream Glibc?

I don't understand how this is supposed to guard against overflow. If I read the code correctly, it does

    if (result + x < UINT_MAX) {
        result += x;
    }

However, if there is an overflow, won't that also apply to the addition in the `if` statement? Since `uint` is unsigned, any unsigned int sum will surely be smaller than `UINT_MAX`.