- fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
when the only reference to it was in an argList on the stack
* kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
a good choice to inline.
* kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
file and added missing code to update valueRefCount. It's the latter that fixes the bug.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9179
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-05-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
+ when the only reference to it was in an argList on the stack
+
+ * kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
+ a good choice to inline.
+ * kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
+ file and added missing code to update valueRefCount. It's the latter that fixes the bug.
+
2005-05-16 Darin Adler <darin@apple.com>
Reviewed by Adele.
return emptyList;
}
+List &List::operator=(const List &b)
+{
+ ListImpBase *bImpBase = b._impBase;
+ ++bImpBase->refCount;
+ if (!_needsMarking)
+ ++bImpBase->valueRefCount;
+ deref();
+ _impBase = bImpBase;
+ return *this;
+}
+
} // namespace KJS
inline ListIterator List::begin() const { return ListIterator(*this); }
inline ListIterator List::end() const { return ListIterator(*this, size()); }
- inline List &List::operator=(const List &b)
- {
- ListImpBase *bImpBase = b._impBase;
- ++bImpBase->refCount;
- deref();
- _impBase = bImpBase;
- return *this;
- }
-
} // namespace KJS
#endif // KJS_LIST_H