Added enumeration mutation function, called by code automatically inserted by the compiler when a collection mutates during fast enumeration.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28610 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2009-09-05 17:43:13 +00:00
parent 271a54ece9
commit b29e4570e7
2 changed files with 17 additions and 0 deletions

View file

@ -29,6 +29,8 @@
#import "GNUstepBase/preface.h"
#import "Foundation/NSArray.h"
#import "Foundation/NSEnumerator.h"
#include "Foundation/NSException.h"
/**
* Simple class for iterating over a collection of objects, usually returned
@ -96,3 +98,14 @@
return len;
}
@end
/**
* objc_enumerationMutation() is called whenever a collection mutates in the
* middle of fast enumeration.
*/
void objc_enumerationMutation(id obj)
{
[NSException raise: NSGenericException
format: @"Collection %@ was mutated while being enumerated",
obj];
}