Ignore:
Timestamp:
Aug 11, 2009, 11:22:41 PM (16 years ago)
Author:
[email protected]
Message:

Make it harder to misuse try* allocation routines
https://bugs.webkit.org/show_bug.cgi?id=27469

Reviewed by Gavin Barraclough

Jump through a few hoops to make it much harder to accidentally
miss null-checking of values returned by the try-* allocation
routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSArray.cpp

    r47022 r47092  
    349349    }
    350350
    351     storage = static_cast<ArrayStorage*>(tryFastRealloc(storage, storageSize(newVectorLength)));
    352     if (!storage) {
     351    if (!tryFastRealloc(storage, storageSize(newVectorLength)).getValue(storage)) {
    353352        throwOutOfMemoryError(exec);
    354353        return;
     
    468467    unsigned newVectorLength = increasedVectorLength(newLength);
    469468
    470     storage = static_cast<ArrayStorage*>(tryFastRealloc(storage, storageSize(newVectorLength)));
    471     if (!storage)
     469    if (!tryFastRealloc(storage, storageSize(newVectorLength)).getValue(storage))
    472470        return false;
    473471
Note: See TracChangeset for help on using the changeset viewer.