changeset 55519:c59f36ed7b52

8226879: Memory leak in Type::hashcons Summary: Call delete on xdual type. Reviewed-by: kvn
author thartmann
date Fri, 28 Jun 2019 09:12:49 +0200
parents 73f1c84ca264
children 33bb8c970770
files src/hotspot/share/opto/type.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/type.cpp	Thu Jun 27 22:03:19 2019 +0200
+++ b/src/hotspot/share/opto/type.cpp	Fri Jun 28 09:12:49 2019 +0200
@@ -730,8 +730,11 @@
   // Since we just discovered a new Type, compute its dual right now.
   assert( !_dual, "" );         // No dual yet
   _dual = xdual();              // Compute the dual
-  if( cmp(this,_dual)==0 ) {    // Handle self-symmetric
-    _dual = this;
+  if (cmp(this, _dual) == 0) {  // Handle self-symmetric
+    if (_dual != this) {
+      delete _dual;
+      _dual = this;
+    }
     return this;
   }
   assert( !_dual->_dual, "" );  // No reverse dual yet