Hi

When compiled with clang sanitizer option
-fsanitize=signed-integer-overflow,  I see the
following error sometimes at runtime when
using gvim-7.4.31:

===
mbyte.c:4622:23: runtime error: signed integer overflow: 2147483647 +
1 cannot be represented in type 'int'
===

I've seen the error twice so far, but I do not
know how to reproduce it.

Code in mbytes.c

4574     static void
4575 im_commit_cb(GtkIMContext *context UNUSED,
....
4594     /* Indicate that preediting has finished. */
4595     if (preedit_start_col == MAXCOL)
4596     {
4597         init_preedit_start_col();
4598         commit_with_preedit = FALSE;
4599     }
....
4622     preedit_start_col += clen;

Integer overflow has undefined behavior in C in theory
(only well defined behavior with unsigned). In practice,
it will most likely wrap but I'm not sure that wrapping
makes sense here anyway.

Value 2147483647 of preedit_start is MAXCOL, which is
expected to happen since line mbytes.c:4595 tests it.

What is meant to be done at line 4622 when preedit_start_col
is MAXCOL? Any idea on how to reproduce the overflow
all the time?

Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui