src/share/vm/classfile/classFileParser.cpp

Print this page

        

@@ -2165,12 +2165,12 @@
       // expression)
       u2 actual_size = 1;
       method_parameters_data = cfs->get_u1_buffer();
       actual_size += 2 * method_parameters_length;
       cfs->skip_u2_fast(method_parameters_length);
-      actual_size += 4 * method_parameters_length;
-      cfs->skip_u4_fast(method_parameters_length);
+      actual_size += 2 * method_parameters_length;
+      cfs->skip_u2_fast(method_parameters_length);
       // Enforce attribute length
       if (method_attribute_length != actual_size) {
         classfile_parse_error(
           "Invalid MethodParameters method attribute length %u in class file %s",
           method_attribute_length, CHECK_(nullHandle));

@@ -2317,18 +2317,14 @@
 
   // Copy method parameters
   if (method_parameters_length > 0) {
     MethodParametersElement* elem = m->constMethod()->method_parameters_start();
     for(int i = 0; i < method_parameters_length; i++) {
-      elem[i].name_cp_index =
-        Bytes::get_Java_u2(method_parameters_data);
+      elem[i].name_cp_index = Bytes::get_Java_u2(method_parameters_data);
+      method_parameters_data += 2;
+      elem[i].flags = Bytes::get_Java_u2(method_parameters_data);
       method_parameters_data += 2;
-      u4 flags = Bytes::get_Java_u4(method_parameters_data);
-      // This caused an alignment fault on Sparc, if flags was a u4
-      elem[i].flags_lo = extract_low_short_from_int(flags);
-      elem[i].flags_hi = extract_high_short_from_int(flags);
-      method_parameters_data += 4;
     }
   }
 
   // Copy checked exceptions
   if (checked_exceptions_length > 0) {