Bug 831658 - Handle multiple RegExpShareds in the same compartment. r=dvander

This commit is contained in:
Sean Stangl 2013-01-17 18:03:34 -08:00
Родитель 3d1624e9a0
Коммит adfe1de262
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,4 @@
// Don't assert.
String.prototype.search = evalcx('').String.prototype.search
x = /./.test()
''.search(/()/)

Просмотреть файл

@ -652,8 +652,7 @@ RegExpCompartment::~RegExpCompartment()
* RegExpStatics may have prevented a single RegExpShared from * RegExpStatics may have prevented a single RegExpShared from
* being collected during RegExpCompartment::sweep(). * being collected during RegExpCompartment::sweep().
*/ */
if (!inUse_.empty()) { for (PendingSet::Enum e(inUse_); !e.empty(); e.popFront()) {
PendingSet::Enum e(inUse_);
RegExpShared *shared = e.front(); RegExpShared *shared = e.front();
JS_ASSERT(shared->activeUseCount == 0); JS_ASSERT(shared->activeUseCount == 0);
js_delete(shared); js_delete(shared);