gfx/angle/angle-abort-on-oom-in-preprocessor.patch
author Justin Lebar <justin.lebar@gmail.com>
Wed, 24 Oct 2012 12:40:35 -0400
changeset 111263 592c3465a74231069e07b10b2a072b54ea0f06b0
parent 100453 c2c60b40fa7fc705db72242c97d49a82403d50ee
permissions -rw-r--r--
Bug 803688 - Remove LinkedListElements from their list when they're destructed, and assert that a LinkedList is empty when it's destructed. r=waldo

# HG changeset patch
# Parent 11023ab3d23865b71678e9a4b22a45646ec0c0f0
diff --git a/gfx/angle/src/compiler/preprocessor/atom.c b/gfx/angle/src/compiler/preprocessor/atom.c
--- a/gfx/angle/src/compiler/preprocessor/atom.c
+++ b/gfx/angle/src/compiler/preprocessor/atom.c
@@ -327,22 +327,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;