Skip to content

Commit

Permalink
[fix #123] receiver object may be changed within NSArray#rindex block
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jul 5, 2012
1 parent b9f969e commit 98e30aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NSArray.m
Expand Up @@ -564,6 +564,11 @@
if (RTEST(test)) {
return LONG2NUM(i);
}
const long n = [rcv count];
if (n < i) {
// Array was modified.
i = n;
}
}
}
else {
Expand Down

0 comments on commit 98e30aa

Please sign in to comment.