6294277: java -Xdebug crashes on SourceDebugExtension attribute larger than 64K

Reviewed-by: sspitsyn, dholmes, coleenp, kamg
This commit is contained in:
Frederic Parain 2012-07-09 01:28:37 -07:00
parent 39dfe6d047
commit 13c689d9c3
12 changed files with 273 additions and 35 deletions

View file

@ -2337,12 +2337,7 @@ void ClassFileParser::parse_classfile_source_debug_extension_attribute(constantP
// Don't bother storing it if there is no way to retrieve it
if (JvmtiExport::can_get_source_debug_extension()) {
// Optimistically assume that only 1 byte UTF format is used
// (common case)
TempNewSymbol sde_symbol = SymbolTable::new_symbol((const char*)sde_buffer, length, CHECK);
k->set_source_debug_extension(sde_symbol);
// Note that set_source_debug_extension() increments the reference count
// for its copy of the Symbol*, so use a TempNewSymbol here.
k->set_source_debug_extension((char*)sde_buffer, length);
}
// Got utf8 string, set stream position forward
cfs->skip_u1(length, CHECK);