Don’t fail the test if we get more attributes than we expect.

Attribute lists are not null-terminated, so this would previously have gone off into memory that it was not meant to access.
main
David Chisnall 10 years ago
parent d692a0ede4
commit 81ef7a9816

@ -281,7 +281,7 @@ static BOOL testPropertyForProperty_alt(objc_property_t p,
attrsList = property_copyAttributeList(p, NULL);
OPT_ASSERT(0 != attrsList);
objc_property_attribute_t *ra;
for (attrsCount = 0, ra = attrsList; ra->name != NULL; attrsCount++, ra++) {}
for (attrsCount = 0, ra = attrsList; (ra->name != NULL) && (attrsCount < size); attrsCount++, ra++) {}
OPT_ASSERT(attrsCount == size);
free(attrsList);
for (unsigned int index=0; index<size; index++) {

Loading…
Cancel
Save