safety tweak suggested by Quentin

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37564 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2014-01-09 09:55:36 +00:00
parent 521df718a9
commit 58d38a26b9

View file

@ -399,11 +399,11 @@ static SEL rlSel;
* iteration. If it changes during the iteration then * iteration. If it changes during the iteration then
* objc_enumerationMutation() will be called, throwing an exception. * objc_enumerationMutation() will be called, throwing an exception.
* The abstract base class implementation points to a fixed value * The abstract base class implementation points to a fixed value
* (the instance itsself is guaranteed to exist for as long as the * (the enumeration state pointer should exist and be unchanged for as
* enumeration process runs), which is fine for enumerating an * long as the enumeration process runs), which is fine for enumerating
* immutable array. * an immutable array.
*/ */
state->mutationsPtr = (unsigned long *)self; state->mutationsPtr = (unsigned long *)&state->mutationsPtr;
count = MIN(len, [self count] - state->state); count = MIN(len, [self count] - state->state);
/* If a mutation has occurred then it's possible that we are being asked to /* If a mutation has occurred then it's possible that we are being asked to
* get objects from after the end of the array. Don't pass negative values * get objects from after the end of the array. Don't pass negative values