Lech Lorens skribis:

> Problem:
> The cursor position is not updated after deleting a fold based on
> markers. This results in an invalid memory reference in some scenarios.
>
> How to reproduce:
> In normal mode perform zRgg$zdaa while editing a file with the following
> contents:
> [[[
> blah blah blah
> ]]]
> vim: fdm=marker fmr=[[[,]]]
>
> Fix:
> The attached patch seems to fix the problem.


I can reproduce the bug that you describe with vim-7.2.69.
Although it does not crash for me, just after typing
'zd' in 'zRgg$zdaa' valgrind reports the following error:

==15028== Invalid read of size 1
==15028==    at 0x813F67B: utf_head_off (mbyte.c:2498)
==15028==    by 0x813FDF5: mb_adjustpos (mbyte.c:2791)
==15028==    by 0x813FDA2: mb_adjust_cursor (mbyte.c:2771)
==15028==    by 0x81439CB: normal_cmd (normal.c:1339)
==15028==    by 0x8106A71: main_loop (main.c:1180)
==15028==    by 0x81065BE: main (main.c:939)
==15028==  Address 0x677bc71 is 1 bytes after a block of size 4,096 alloc'd
==15028==    at 0x4025D2E: malloc (vg_replace_malloc.c:207)
==15028==    by 0x8133F88: lalloc (misc2.c:859)
==15028==    by 0x8133EA4: alloc (misc2.c:758)
==15028==    by 0x8113D37: mf_alloc_bhdr (memfile.c:973)
==15028==    by 0x8113357: mf_new (memfile.c:395)
==15028==    by 0x8119235: ml_new_data (memline.c:3164)
==15028==    by 0x811484B: ml_open (memline.c:373)
==15028==    by 0x8073C80: open_buffer (buffer.c:85)
==15028==    by 0x810863B: create_windows (main.c:2483)
==15028==    by 0x8106351: main (main.c:798)

I confirm that your patch fixes it.

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui