Loading ...
Sorry, an error occurred while loading the content.

Re: [patch] Crash with EOL visual-block over a fold

Expand Messages
  • Bram Moolenaar
    ... Thanks! I was just looking into this problem. Your patch seems like it s the right solution. -- ... Ceci n est pas une pipe. /// Bram Moolenaar --
    Message 1 of 2 , Sep 2, 2011
    • 0 Attachment
      James Vega wrote:

      > If one uses <C-v>$ to start visual-block mode, and then moves the cursor
      > over a fold, Vim will crash. As a simple test, you can follow the
      > commands below with this email.
      >
      > " :set fdm=3Dmarker
      > " zM
      > " <C-v>$jG
      > {{{
      > screen.c:
      > 2534 if (wp->w_old_cursor_lcol + txtcol < (colnr_T)W_WIDTH(wp))=C2=B6
      > 2535 len =3D wp->w_old_cursor_lcol;=C2=B6
      > 2536 else=C2=B6
      > 2537 len =3D W_WIDTH(wp) - txtcol;=C2=B6
      > 2538 RL_MEMSET(wp->w_old_cursor_fcol + txtcol, hl_attr(HLF_V),=C2=B6
      > 2539 len - (int)wp->w_old_cursor_fcol);=C2=B6
      > }}}
      >
      > This is due to wp->w_old_cursor_lcol being set to MAXCOL, so the sum in
      > the above comparison overflows and incorrectly causes the comparison to
      > succeed. So, RL_MEMSET walks off the end of ScreenAttrs.
      >
      > Attached patch fixes the problem.

      Thanks! I was just looking into this problem. Your patch seems like
      it's the right solution.

      --
      |

      Ceci n'est pas une pipe.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.