mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
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:
parent
ae35dfeeec
commit
be0c8e9f08
4 changed files with 58 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue