Bug 690970, part 1: unmark gray read barrier for weak maps. r=billm
This commit is contained in:
@@ -209,6 +209,10 @@ WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
|
||||
if (ObjectValueMap *map = GetObjectMap(&args.thisv().toObject())) {
|
||||
if (ObjectValueMap::Ptr ptr = map->lookup(key)) {
|
||||
// Read barrier to prevent an incorrectly gray value from escaping the
|
||||
// weak map. See the comment before UnmarkGrayChildren in gc/Marking.cpp
|
||||
ExposeValueToActiveJS(ptr->value.get());
|
||||
|
||||
args.rval().set(ptr->value);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user