8006005: Fix constant pool index validation and alignment trap for method parameter reflection

This patch addresses an alignment trap due to the storage format of method parameters data in constMethod.  It also adds code to validate constant pool indexes for method parameters data.

Reviewed-by: jrose, dholmes
This commit is contained in:
Eric Mccorkle 2013-01-14 11:01:39 -05:00 committed by Coleen Phillimore
parent ae35dfeeec
commit be0c8e9f08
4 changed files with 58 additions and 15 deletions

View file

@ -862,7 +862,15 @@ oop Reflection::new_field(fieldDescriptor* fd, bool intern_name, TRAPS) {
oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
int flags, TRAPS) {
Handle name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
Handle name;
// A null symbol here translates to the empty string
if(NULL != sym) {
name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
} else {
name = java_lang_String::create_from_str("", CHECK_NULL);
}
Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);
java_lang_reflect_Parameter::set_name(rh(), name());
java_lang_reflect_Parameter::set_modifiers(rh(), flags);