diff src/share/vm/compiler/disassembler.cpp @ 20435:094cbdffa87d

8054292: code comments leak in fastdebug builds Summary: Added deallocation to destructor; hardened interface against misuse Reviewed-by: kvn
author drchase
date Fri, 29 Aug 2014 19:45:49 -0400
parents 78bbf4d43a14
children 7848fc12602b
line wrap: on
line diff
--- a/src/share/vm/compiler/disassembler.cpp	Wed Sep 03 15:26:06 2014 +0400
+++ b/src/share/vm/compiler/disassembler.cpp	Fri Aug 29 19:45:49 2014 -0400
@@ -245,12 +245,12 @@
 };
 
 decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) {
-  memset(this, 0, sizeof(*this));
+  memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields.
   _output = output ? output : tty;
   _code = code;
   if (code != NULL && code->is_nmethod())
     _nm = (nmethod*) code;
-  _strings.assign(c);
+  _strings.copy(c);
 
   // by default, output pc but not bytes:
   _print_pc       = true;