[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6378: all-completions Segfault
From: |
Thierry Volpiatto |
Subject: |
bug#6378: all-completions Segfault |
Date: |
Wed, 09 Jun 2010 07:13:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>> Although I don't understand why the code-path for the vector
>> version can't be simplified as in the following patch, which also
>> fixes the problem AFAICT:
>
>> diff --git a/src/minibuf.c b/src/minibuf.c
>> index ad81bfd..c6aae27 100644
>> --- a/src/minibuf.c
>> +++ b/src/minibuf.c
>> @@ -1610,22 +1610,14 @@ with a space are ignored unless STRING itself starts
>> with a space. */)
>> }
>> else if (type == 2)
>> {
>> - if (!EQ (bucket, zero))
>> - {
>> - elt = bucket;
>> - eltstring = elt;
>> - if (XSYMBOL (bucket)->next)
>> - XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
>> - else
>> - XSETFASTINT (bucket, 0);
>> - }
>> - else if (++index >= obsize)
>> - break;
>> - else
>> - {
>> - bucket = XVECTOR (collection)->contents[index];
>> - continue;
>> - }
>> + if ( index < obsize )
>> + {
>> + elt = bucket;
>> + eltstring = elt;
>> + bucket = XVECTOR (collection)->contents[++index];
>> + }
>> + else
>> + break;
>> }
>> else /* if (type == 3) */
>> {
>
> IIUC this would only loop through all the buckets, without looping
> through each bucket's linked list.
> Compare (length obarray)
> and (let ((i 0)) (mapatoms (lambda (_) (incf i)) obarray) i)
Don't know if that related but
(completing-read "test: " [1 2 3 23 24 34 26 40 28])
test: 2 ==> TAB
instead of failing crash emacs.
--
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/
bug#6378: all-completions Segfault, Lawrence Mitchell, 2010/06/08
- bug#6378: all-completions Segfault, Stefan Monnier, 2010/06/08
- bug#6378: all-completions Segfault,
Thierry Volpiatto <=
- bug#6378: all-completions Segfault, Thierry Volpiatto, 2010/06/09
- bug#6378: all-completions Segfault, Lennart Borgman, 2010/06/09
- bug#6378: all-completions Segfault, Thierry Volpiatto, 2010/06/09
- bug#6378: all-completions Segfault, Lennart Borgman, 2010/06/09
- bug#6378: all-completions Segfault, Thierry Volpiatto, 2010/06/09
- bug#6378: all-completions Segfault, Andreas Schwab, 2010/06/09
- bug#6378: all-completions Segfault, Thierry Volpiatto, 2010/06/09
- bug#6378: all-completions Segfault, Andreas Schwab, 2010/06/09
bug#6378: all-completions Segfault, Lawrence Mitchell, 2010/06/09