From 121650fae00b5d8e9431cc3df6f0eaacce633d32 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 28 Jan 2009 23:43:05 +0000 Subject: [PATCH] Bugfixes for last patch git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27715 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/GSArray.m | 3 ++- Source/NSEnumerator.m | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index feb9090e4..47c0860a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-28 Richard Frith-Macdonald + + * Source/NSEnumerator.m: Fix bug in fast enumeration code. + * Source/GSArray.m: Fix bug in array insertion introduced by last patch. + 2009-01-28 David Chisnall * Headers/Foundation/NSEnumerator.h: diff --git a/Source/GSArray.m b/Source/GSArray.m index 1375e3358..a8d22eaae 100644 --- a/Source/GSArray.m +++ b/Source/GSArray.m @@ -619,7 +619,8 @@ static Class GSInlineArrayClass; _capacity += _grow_factor; _grow_factor = _capacity/2; } - memmove(&_contents_array[index], &_contents_array[index+1], _count - index); + memmove(&_contents_array[index+1], &_contents_array[index], + (_count - index) * sizeof(id)); /* * Make sure the array is 'sane' so that it can be deallocated * safely by an autorelease pool if the '[anObject retain]' causes diff --git a/Source/NSEnumerator.m b/Source/NSEnumerator.m index 771c4e31d..297fcc754 100644 --- a/Source/NSEnumerator.m +++ b/Source/NSEnumerator.m @@ -91,7 +91,7 @@ } *(stackbuf+i) = next; } - state->itemsPtr; + state->itemsPtr = stackbuf; return len; } @end