mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/thread/thread.c (remove_one): Preserve List invariants;
submitted by: MenTaLguY <mental AT rydia.net> in [ruby-core:10598] and [ruby-bugs:PR#9388]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
59aac16283
commit
1bb22ded25
2 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Mar 21 07:21:24 2007 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/thread/thread.c (remove_one): Preserve List invariants;
|
||||
submitted by: MenTaLguY <mental AT rydia.net>
|
||||
in [ruby-core:10598] and [ruby-bugs:PR#9388].
|
||||
|
||||
Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* marshal.c (w_extended): erroneous check condition when dump
|
||||
|
|
|
@ -163,13 +163,18 @@ static void
|
|||
remove_one(List *list, VALUE value)
|
||||
{
|
||||
Entry **ref;
|
||||
Entry *prev;
|
||||
Entry *entry;
|
||||
|
||||
for (ref = &list->entries, entry = list->entries;
|
||||
for (ref = &list->entries, prev = NULL, entry = list->entries;
|
||||
entry != NULL;
|
||||
ref = &entry->next, entry = entry->next) {
|
||||
ref = &entry->next, prev = entry, entry = entry->next) {
|
||||
if (entry->value == value) {
|
||||
*ref = entry->next;
|
||||
list->size--;
|
||||
if (!entry->next) {
|
||||
list->last_entry = prev;
|
||||
}
|
||||
recycle_entries(list, entry, entry);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue