Bug 580128. Remove cross origin string wrappers from hash when the wrapped string dies. r=mrbkap.

As a note: this bug took peterv and mrbkap 7 hours to track down using replay debugging after spending hours trying to even catch it on a replay debugging box.
This commit is contained in:
Peter Van der Beken 2010-10-10 15:49:38 -07:00
parent ab0c961743
commit c914f1d5dd

View File

@ -334,8 +334,13 @@ JSCompartment::sweep(JSContext *cx)
chunk = NULL;
/* Remove dead wrappers from the table. */
for (WrapperMap::Enum e(crossCompartmentWrappers); !e.empty(); e.popFront()) {
if (IsAboutToBeFinalized(e.front().value.toGCThing()))
JS_ASSERT_IF(IsAboutToBeFinalized(e.front().key.toGCThing()) &&
!IsAboutToBeFinalized(e.front().value.toGCThing()),
e.front().key.isString());
if (IsAboutToBeFinalized(e.front().key.toGCThing()) ||
IsAboutToBeFinalized(e.front().value.toGCThing())) {
e.removeFront();
}
}
#if defined JS_METHODJIT && defined JS_MONOIC