8054292: code comments leak in fastdebug builds

Added deallocation to destructor; hardened interface against misuse

Reviewed-by: kvn
This commit is contained in:
David Chase 2014-08-29 19:45:49 -04:00
parent 3eb44b3955
commit 4c9f643e10
5 changed files with 81 additions and 11 deletions

View file

@ -246,12 +246,12 @@ class decode_env {
};
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;