mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1136806 - Fix assertion failure with Debugger and oomAfterAllocations. r=shu
This commit is contained in:
parent
a3d6378544
commit
a235485fdb
5
js/src/jit-test/tests/debug/bug-1136806.js
Normal file
5
js/src/jit-test/tests/debug/bug-1136806.js
Normal file
@ -0,0 +1,5 @@
|
||||
// |jit-test| allow-unhandlable-oom; allow-oom
|
||||
Debugger()
|
||||
oomAfterAllocations(6)
|
||||
Debugger()
|
||||
|
@ -70,9 +70,20 @@ class DebuggerWeakMap : private WeakMap<PreBarriered<UnbarrieredKey>, Relocatabl
|
||||
|
||||
public:
|
||||
typedef WeakMap<Key, Value, DefaultHasher<Key> > Base;
|
||||
|
||||
explicit DebuggerWeakMap(JSContext *cx)
|
||||
: Base(cx), zoneCounts(cx->runtime()) { }
|
||||
|
||||
~DebuggerWeakMap() {
|
||||
// If our owning Debugger fails construction after already initializing
|
||||
// this DebuggerWeakMap, we need to make sure that we aren't in the
|
||||
// compartment's weak map list anymore. Normally, when we are destroyed
|
||||
// because the GC finds us unreachable, the GC takes care of removing us
|
||||
// from this list.
|
||||
if (WeakMapBase::isInList())
|
||||
WeakMapBase::removeWeakMapFromList(this);
|
||||
}
|
||||
|
||||
public:
|
||||
/* Expose those parts of HashMap public interface that are used by Debugger methods. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user