8226879: Memory leak in Type::hashcons
Summary: Call delete on xdual type.
Reviewed-by: kvn
--- 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