1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Fix bug in remqueue in threads.c when removing last element.

Reported and debugged by Andrew Gaylard <ag@computer.org>.

* libguile/threads.c (remqueue): When removing the last element from a
  queue with more than one element, set (car q) to the previous element.

* THANKS: Thank Andrew Gaylard.
This commit is contained in:
Mark H Weaver 2013-06-17 14:43:58 -04:00
parent b16bf64639
commit 10454601e0
2 changed files with 2 additions and 1 deletions

1
THANKS
View file

@ -77,6 +77,7 @@ For fixes or providing information which led to a fix:
Fu-gangqiang Fu-gangqiang
Aidan Gauland Aidan Gauland
Peter Gavin Peter Gavin
Andrew Gaylard
Nils Gey Nils Gey
Eric Gillespie, Jr Eric Gillespie, Jr
Didier Godefroy Didier Godefroy

View file

@ -327,7 +327,7 @@ remqueue (SCM q, SCM c)
if (scm_is_eq (p, c)) if (scm_is_eq (p, c))
{ {
if (scm_is_eq (c, SCM_CAR (q))) if (scm_is_eq (c, SCM_CAR (q)))
SCM_SETCAR (q, SCM_CDR (c)); SCM_SETCAR (q, scm_is_eq (prev, q) ? SCM_EOL : prev);
SCM_SETCDR (prev, SCM_CDR (c)); SCM_SETCDR (prev, SCM_CDR (c));
/* GC-robust */ /* GC-robust */