[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

fixed vim at crest:/home/ballombe/vim



Hello Luca and Debian-m68k,

I have managed to build a vim that does not just segfault
when you press an arrow key on crest.
I have copied it at crest:/home/ballombe/vim.

AFAICT, the bug is a nasty optimisation bug when compiling the file term.c.
Probably linked to alignement problem:

We have

term.c    
    int         slen = 0;       /* init for GCC */
    int         len;
    int         offset;
    char_u      key_name[2];

 The following line
                    key_name[0] = termcodes[idx].name[0];

clobber slen, but not key_name...

Compiling term.c without -O2 fix it. 

The following patch seems to fix it as well with -O2.

--- term.c.old  2003-04-27 14:27:29.000000000 +0200
+++ term.c      2003-04-27 14:16:19.000000000 +0200
@@ -3646,7 +3646,7 @@
     int                slen = 0;       /* init for GCC */
     int                len;
     int                offset;
-    char_u     key_name[2];
+    char_u     key_name[4];
     int                new_slen;
     int                extra;
     char_u     string[MAX_KEY_CODE_LEN + 1];

Now it looks like a bug in gcc with optimisation and alignement.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 



Reply to: