[INFER] Always monitor accesses on __proto__ and similar properties, bug 645044.

This commit is contained in:
Brian Hackett 2011-03-29 06:18:44 -07:00
parent e8661b558f
commit 6583f29906
2 changed files with 11 additions and 7 deletions

View File

@ -0,0 +1,4 @@
this.__defineGetter__("x", gc);
x.__proto__ = this;
__proto__ = 44;

View File

@ -839,13 +839,6 @@ PropertyAccess(JSContext *cx, JSScript *script, const jsbytecode *pc, TypeObject
{
JS_ASSERT_IF(!target, assign);
/* Reads from objects with unknown properties are unknown, writes to such objects are ignored. */
if (object->unknownProperties) {
if (!assign)
target->addType(cx, TYPE_UNKNOWN);
return;
}
/* Monitor assigns on the 'prototype' property. */
if (assign && id == id_prototype(cx)) {
cx->compartment->types.monitorBytecode(cx, script, pc - script->code);
@ -861,6 +854,13 @@ PropertyAccess(JSContext *cx, JSScript *script, const jsbytecode *pc, TypeObject
return;
}
/* Reads from objects with unknown properties are unknown, writes to such objects are ignored. */
if (object->unknownProperties) {
if (!assign)
target->addType(cx, TYPE_UNKNOWN);
return;
}
/* Capture the effects of a standard property access. */
if (target) {
TypeSet *types = object->getProperty(cx, id, assign);