all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#6378: all-completions Segfault
Date: Wed, 09 Jun 2010 07:13:31 +0200	[thread overview]
Message-ID: <874ohcbxfo.fsf@tux.homenetwork> (raw)
In-Reply-To: <AANLkTimXG8KLpCE8oINzI4btpgGQOc38SLAsHHY266XO@mail.gmail.com>

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/






  reply	other threads:[~2010-06-09  5:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 15:46 bug#6378: all-completions Segfault Nathan Weizenbaum
2010-06-08 16:37 ` Lawrence Mitchell
2010-06-08 20:30   ` Stefan Monnier
2010-06-09  5:13     ` Thierry Volpiatto [this message]
2010-06-09  6:13       ` Lennart Borgman
2010-06-09  7:23         ` Thierry Volpiatto
2010-06-09  8:51           ` Lennart Borgman
2010-06-09 10:05             ` Thierry Volpiatto
2010-06-09 11:43               ` Andreas Schwab
2010-06-09 12:01                 ` Thierry Volpiatto
2010-06-09 12:13                   ` Andreas Schwab
2010-06-09  6:18       ` Thierry Volpiatto
2010-06-09  9:09     ` Lawrence Mitchell
2010-06-08 16:41 ` Juanma Barranquero
2010-06-08 16:53   ` Juanma Barranquero
2010-06-08 18:58     ` Lennart Borgman
2010-06-08 19:08       ` Juanma Barranquero
2010-06-08 19:32         ` Lennart Borgman
2010-06-08 19:57           ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ohcbxfo.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.