Bug 1025576 - Fix crash in TSymbolTableLevel::~TSymbolTableLevel with GCC 4.9. r=bjacob, a=sledru
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 17 Jun 2014 07:15:36 +0900
changeset 200584 0132fb8d61f7ce126aeed927618926e5c28ddd39
parent 200583 bbb49a5a33040a5ea1c9cd60d39fb54877afb055
child 200585 ebba60c06474de1752493552e5d153095723983c
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob, sledru
bugs1025576
milestone31.0
Bug 1025576 - Fix crash in TSymbolTableLevel::~TSymbolTableLevel with GCC 4.9. r=bjacob, a=sledru
gfx/angle/README.mozilla
gfx/angle/angle-fix-issue-651.patch
gfx/angle/src/compiler/SymbolTable.cpp
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -55,16 +55,19 @@ In this order:
     https://chromium.googlesource.com/angle/angle/+/0685fbde65a3e90d8d4d4a6c72f2cc1771617fd0
 
   angle-fix-vc12.patch:
     Fixes angle to build on Visual Studio 2013
 
   angle-d3dcc47.patch:
     Tell ANGLE about d3dcompiler_47.dll from WinSDK 8.1.
 
+  angle-fix-issue-651.patch:
+    Fixes crash in TSymbolTableLevel::~TSymbolTableLevel with GCC 4.9
+
 In addition to these patches, the Makefile.in and moz.build build files are ours,
 they're not present in upsteam ANGLE. Therefore, changes made to the build files
 should not be stored in the local .patch files.
 
 
 == How to do a clean-slate upgrade ==
 1.  Backup our moz-specific files:
       README.mozilla
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-fix-issue-651.patch
@@ -0,0 +1,27 @@
+Fix for https://code.google.com/p/angleproject/issues/detail?id=651
+
+See https://bugzilla.mozilla.org/show_bug.cgi?id=1025576 for details.
+
+diff --git a/gfx/angle/src/compiler/SymbolTable.cpp b/gfx/angle/src/compiler/SymbolTable.cpp
+--- a/gfx/angle/src/compiler/SymbolTable.cpp
++++ b/gfx/angle/src/compiler/SymbolTable.cpp
+@@ -166,17 +166,18 @@ TFunction::~TFunction()
+ }
+ 
+ //
+ // Symbol table levels are a map of pointers to symbols that have to be deleted.
+ //
+ TSymbolTableLevel::~TSymbolTableLevel()
+ {
+     for (tLevel::iterator it = level.begin(); it != level.end(); ++it)
+-        delete (*it).second;
++        if ((*it).first == (*it).second->getMangledName())
++            delete (*it).second;
+ }
+ 
+ //
+ // Change all function entries in the table with the non-mangled name
+ // to be related to the provided built-in operation.  This is a low
+ // performance operation, and only intended for symbol tables that
+ // live across a large number of compiles.
+ //
--- a/gfx/angle/src/compiler/SymbolTable.cpp
+++ b/gfx/angle/src/compiler/SymbolTable.cpp
@@ -166,17 +166,18 @@ TFunction::~TFunction()
 }
 
 //
 // Symbol table levels are a map of pointers to symbols that have to be deleted.
 //
 TSymbolTableLevel::~TSymbolTableLevel()
 {
     for (tLevel::iterator it = level.begin(); it != level.end(); ++it)
-        delete (*it).second;
+        if ((*it).first == (*it).second->getMangledName())
+            delete (*it).second;
 }
 
 //
 // Change all function entries in the table with the non-mangled name
 // to be related to the provided built-in operation.  This is a low
 // performance operation, and only intended for symbol tables that
 // live across a large number of compiles.
 //