Bug 748654 - manually abort on allocation failure - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 30 Apr 2012 17:43:12 -0400
changeset 92763 6984143425158aedc921f58ba06d8577a815b16f
parent 92762 934967d88037b70612ecceab2bc18481d5498ae2
child 92764 4bb0aa38c2d43afbf5248e6a012ebf80a7638a5d
push id8858
push userbjacob@mozilla.com
push dateMon, 30 Apr 2012 21:43:24 +0000
treeherdermozilla-inbound@4bb0aa38c2d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs748654
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 748654 - manually abort on allocation failure - r=jgilbert
gfx/angle/src/compiler/preprocessor/atom.c
--- a/gfx/angle/src/compiler/preprocessor/atom.c
+++ b/gfx/angle/src/compiler/preprocessor/atom.c
@@ -326,22 +326,17 @@ static int GrowAtomTable(AtomTable *atab
             newmap = realloc(atable->amap, sizeof(int)*size);
             newrev = realloc(atable->arev, sizeof(int)*size);
         } else {
             newmap = malloc(sizeof(int)*size);
             newrev = malloc(sizeof(int)*size);
             atable->size = 0;
         }
         if (!newmap || !newrev) {
-            /* failed to grow -- error */
-            if (newmap)
-                atable->amap = newmap;
-            if (newrev)
-                atable->arev = newrev;
-            return -1;
+            abort();
         }
         memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));
         memset(&newrev[atable->size], 0, (size - atable->size) * sizeof(int));
         atable->amap = newmap;
         atable->arev = newrev;
         atable->size = size;
     }
     return 0;