changeset 51715:b139131bfcbd datum

skip the record attribute during class file parsing for now
author vromero
date Thu, 12 Jul 2018 12:54:12 -0700
parents 1469f48bf928
children 738e9ab393f2
files src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/classfile/vmSymbols.hpp
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classFileParser.cpp	Wed Jul 11 15:13:07 2018 -0700
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Thu Jul 12 12:54:12 2018 -0700
@@ -3371,6 +3371,7 @@
   bool parsed_innerclasses_attribute = false;
   bool parsed_nest_members_attribute = false;
   bool parsed_nest_host_attribute = false;
+  bool parsed_record_attribute = false;
   bool parsed_enclosingmethod_attribute = false;
   bool parsed_bootstrap_methods_attribute = false;
   const u1* runtime_visible_annotations = NULL;
@@ -3390,6 +3391,8 @@
   u2  enclosing_method_method_index = 0;
   const u1* nest_members_attribute_start = NULL;
   u4  nest_members_attribute_length = 0;
+  const u1* record_attribute_start = NULL;
+  u4  record_attribute_length = 0;
 
   // Iterate over attributes
   while (attributes_count--) {
@@ -3572,9 +3575,18 @@
                          "Nest-host class_info_index %u has bad constant type in class file %s",
                          class_info_index, CHECK);
           _nest_host = class_info_index;
+        } else if (tag == vmSymbols::tag_record()) {
+          if (parsed_record_attribute) {
+            classfile_parse_error("Multiple Record attributes in class file %s", CHECK);
+          } else {
+            parsed_record_attribute = true;
+          }
+          record_attribute_start = cfs->current();
+          record_attribute_length = attribute_length;
+          cfs->skip_u1(record_attribute_length, CHECK);
         }
       } else {
-        // Unknown attribute
+        // Unknown attribute 
         cfs->skip_u1(attribute_length, CHECK);
       }
     } else {
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Wed Jul 11 15:13:07 2018 -0700
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Thu Jul 12 12:54:12 2018 -0700
@@ -156,6 +156,7 @@
   template(tag_deprecated,                            "Deprecated")                               \
   template(tag_source_debug_extension,                "SourceDebugExtension")                     \
   template(tag_signature,                             "Signature")                                \
+  template(tag_record,                                "Record")                                   \
   template(tag_runtime_visible_annotations,           "RuntimeVisibleAnnotations")                \
   template(tag_runtime_invisible_annotations,         "RuntimeInvisibleAnnotations")              \
   template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations")       \