Dominique Pelle wrote:Thanks, I'll add this to the todo list.
> Here are more signed int overflows with undefined behavior
> discovered with the IOC tool (http://embed.cs.utah.edu/ioc/):
> CLANG ARITHMETIC UNDEFINED at <move.c, (2591:12)> : Op: +, Reason :
> CLANG ARITHMETIC UNDEFINED at <move.c, (2603:12)> : Op: +, Reason :
> CLANG ARITHMETIC UNDEFINED at <move.c, (2603:41)> : Op: +, Reason :
> I can reproduce these overflows as follows:
> $ yes 1 | head -5 > 1
> Then press <PgDown> followed by <PgUp> and the overflow happens.
> Even assuming a two's complement representation of
> 2591 if (h3 + h2 > min_height)
> h3 and/or h2 are signed int variables. They can be
> Attached patch fixes it but please review it.
> IOC tool no longer complains with the patch.
/// Bram Moolenaar -- B...@Moolenaar.net -- http://www.Moolenaar.net \\\
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.