On Mon, 7 Jan 2013, Jakub Jelinek wrote:
Won't the above preclude parsing 2147483640 up to 2147483647 ?
Because then in the last iteration count 214748364 > (INT_MAX - 9) / 10.
You're right -- thanks for catching that! Below is a patch with a more
precise check.
Nickolai.
--- libiberty/cpl
consume_count() in libiberty/cplus-dem.c relies on signed integer overflow
(which is undefined behavior in C) to detect overflow when parsing a count
value. As a result, recent versions of gcc (e.g., 4.7.2) will remove that
if check altogether as dead code, since it can only be true with UB. T