Kazunobu Kuriyama wrote:

> 2017-01-16 0:53 GMT+09:00 Bram Moolenaar <[email protected]>:
> 
> >
> > Patch 8.0.0190
> > Summary:    finding duplicate tags uses a slow linear search
> > Problem:    Detecting duplicate tags uses a slow linear search.
> > Solution:   Use a much faster hash table solution. (James McCoy, closes
> > #1046)
> >             But don't add hi_keylen, it makes hash tables 50% bigger.
> > Files:      src/tag.c
> >
> >
> With this patch, CTRL-] in normal mode, or :tag, sometimes fails to work
> for me.
> 
> For example, go to vim/src/ and open vim there.  Do ":make tags" and ":edit
> gui.c".  Place the cursor at gui_attempt_start() at line 110 and press
> CTRL-].
> 
> Then I got either of them, depending on circumstances:
> 
> (1) no response
> (2) an error message: E429: File
> "tags^A^Agui_attempt_start^Igui.c^I/^gui_attempt_start(void)$/ead_ref" does
> not exist (N.B. The substring after $/ often varies).
> (3) segfault
> 
> Those clearly indicate that memory corruption takes place somewhere
> (Therefore, I believe the procedure above is not necessarily useful to
> reproduce the issue for everyone).

Not sure why this wasn't caught by tests.  I changed using NUL as
separator to using 0x01, so that it works as a hash table key.

> FWIW, I applied the patch of #1046 to 8.0.0176 to see if there was a
> difference, and found that it worked fine.
> 
> It appears to me that a big difference between 8.0.0190 and #1046 is the
> usage of the local variable cmplen defined at tag.c:1320.
> 
> #1046 defines a new variable of the same name at line 2215 of the patched
> tag.c, although it shadows cmplen in the outer scope.
> 
> On the other hand, 8.0.0190 does away with the one introduced by #1046.
> 
> Does this make sense?

I'll look into it as soon as I find time.

It would help to have a test function that fails.  Several tags just work, I
wonder what's special about your example with gui_attempt_start.

-- 
Facepalm reply #3: "I had a great time in Manhattan" "I thought you were
going to New York?"

 /// Bram Moolenaar -- [email protected] -- 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

--- 
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/d/optout.

Raspunde prin e-mail lui