зеркало из https://github.com/mozilla/pjs.git
Bug 565463 - Error-reporting mistakes with new-style Auto* classes. r=jorendorff
--HG-- extra : rebase_source : b6e27bd686570bcc77e6650c156ae6f027509646
This commit is contained in:
Родитель
ccf6d88bac
Коммит
88c8a6d1a0
|
@ -340,8 +340,10 @@ class HashTable : AllocPolicy
|
|||
}
|
||||
|
||||
capacity = roundUp;
|
||||
if (capacity >= sSizeLimit)
|
||||
if (capacity >= sSizeLimit) {
|
||||
this->reportAllocOverflow();
|
||||
return false;
|
||||
}
|
||||
|
||||
table = createTable(*this, capacity);
|
||||
if (!table)
|
||||
|
@ -490,8 +492,10 @@ class HashTable : AllocPolicy
|
|||
uint32 oldCap = tableCapacity;
|
||||
uint32 newLog2 = sHashBits - hashShift + deltaLog2;
|
||||
uint32 newCapacity = JS_BIT(newLog2);
|
||||
if (newCapacity >= sSizeLimit)
|
||||
if (newCapacity >= sSizeLimit) {
|
||||
this->reportAllocOverflow();
|
||||
return false;
|
||||
}
|
||||
|
||||
Entry *newTable = createTable(*this, newCapacity);
|
||||
if (!newTable)
|
||||
|
|
|
@ -159,10 +159,8 @@ Enumerate(JSContext *cx, JSObject *obj, JSObject *pobj, jsid id,
|
|||
if (JS_UNLIKELY(!!p))
|
||||
return true;
|
||||
/* no need to add properties to the hash table at the end of the prototype chain */
|
||||
if (pobj->getProto() && !ht.add(p, id)) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
if (pobj->getProto() && !ht.add(p, id))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (enumerable) {
|
||||
if (!vec.append(ID_TO_VALUE(id))) {
|
||||
|
@ -238,10 +236,8 @@ InitNativeIterator(JSContext *cx, JSObject *obj, uintN flags, uint32 *sarray, ui
|
|||
uint32 key, NativeIterator **nip)
|
||||
{
|
||||
HashSet<jsid> ht(cx);
|
||||
if (!(flags & JSITER_OWNONLY) && !ht.init(32)) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
if (!(flags & JSITER_OWNONLY) && !ht.init(32))
|
||||
return false;
|
||||
}
|
||||
|
||||
AutoValueVector props(cx);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче