comparison src/share/vm/runtime/reflection.cpp @ 7588:f9eb431c3efe

8006005: Fix constant pool index validation and alignment trap for method parameter reflection Summary: 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 Contributed-by: eric.mccorkle@oracle.com
author coleenp
date Mon, 14 Jan 2013 11:01:39 -0500
parents ade95d680b42
children a589c78a8811
comparison
equal deleted inserted replaced
7586:90a92d5bca17 7588:f9eb431c3efe
860 return rh(); 860 return rh();
861 } 861 }
862 862
863 oop Reflection::new_parameter(Handle method, int index, Symbol* sym, 863 oop Reflection::new_parameter(Handle method, int index, Symbol* sym,
864 int flags, TRAPS) { 864 int flags, TRAPS) {
865 Handle name = java_lang_String::create_from_symbol(sym, CHECK_NULL); 865 Handle name;
866
867 // A null symbol here translates to the empty string
868 if(NULL != sym) {
869 name = java_lang_String::create_from_symbol(sym, CHECK_NULL);
870 } else {
871 name = java_lang_String::create_from_str("", CHECK_NULL);
872 }
873
866 Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL); 874 Handle rh = java_lang_reflect_Parameter::create(CHECK_NULL);
867 java_lang_reflect_Parameter::set_name(rh(), name()); 875 java_lang_reflect_Parameter::set_name(rh(), name());
868 java_lang_reflect_Parameter::set_modifiers(rh(), flags); 876 java_lang_reflect_Parameter::set_modifiers(rh(), flags);
869 java_lang_reflect_Parameter::set_executable(rh(), method()); 877 java_lang_reflect_Parameter::set_executable(rh(), method());
870 java_lang_reflect_Parameter::set_index(rh(), index); 878 java_lang_reflect_Parameter::set_index(rh(), index);