Root strings in native iterators when converting from array of jsids, bug 719686. r=dvander

This commit is contained in:
Brian Hackett 2012-01-20 16:22:16 -08:00
parent d3c4674f4d
commit e927f18f77

View File

@ -513,12 +513,13 @@ NativeIterator::allocateIterator(JSContext *cx, uint32_t slength, const AutoIdVe
+ slength * sizeof(Shape *));
if (!ni)
return NULL;
AutoValueVector strings(cx);
ni->props_array = ni->props_cursor = (HeapPtr<JSFlatString> *) (ni + 1);
ni->props_end = ni->props_array + plength;
if (plength) {
for (size_t i = 0; i < plength; i++) {
JSFlatString *str = IdToString(cx, props[i]);
if (!str)
if (!str || !strings.append(StringValue(str)))
return NULL;
ni->props_array[i].init(str);
}