[INFER] Avoid spurious censoring of type barriers on writes of 'undefined' to singleton objects, bug 682345.

This commit is contained in:
Brian Hackett 2011-08-26 20:21:59 -07:00
Родитель a6edf630e5
Коммит f2f576fcd3
2 изменённых файлов: 16 добавлений и 1 удалений

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

@ -0,0 +1,15 @@
for (var i = 0; i <= 0x017f; i++) {
var U = new Unicode(i);
}
function Unicode(c) {
u = GetUnicodeValues(c);
this.upper = u[0];
}
function GetUnicodeValues(c) {
u = new Array();
if ((c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178)) try {} finally {
return;
}
return u;
}

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

@ -2262,7 +2262,7 @@ ScriptAnalysis::addTypeBarrier(JSContext *cx, const jsbytecode *pc, TypeSet *tar
/* Ignore duplicate barriers. */
TypeBarrier *barrier = code.typeBarriers;
while (barrier) {
if (barrier->target == target && barrier->type == type)
if (barrier->target == target && barrier->type == type && !barrier->singleton)
return;
barrier = barrier->next;
}