File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3289,7 +3289,7 @@ void ClassFileParser::parse_classfile_bootstrap_methods_attribute(const ClassFil
3289
3289
// representing bootstrap specifiers:
3290
3290
// length*{bootstrap_method_index, argument_count, argument_count*{argument_index}}
3291
3291
const u4 attribute_tail_length = attribute_byte_length - static_cast <u4>(sizeof (u2));
3292
-
3292
+ assert (attribute_tail_length % sizeof (u2) == 0 , " " );
3293
3293
Array<u4>* const offsets =
3294
3294
MetadataFactory::new_array<u4>(_loader_data, num_bootstrap_methods, CHECK);
3295
3295
Array<u2>* const entries = // u2 data holding all the BSM attribute entries
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ class BSMAttributeEntry {
104
104
// how to locate one of these inside a packed u2 data array:
105
105
static BSMAttributeEntry* entry_at_offset (Array<u2>* entries, int offset) {
106
106
assert (0 <= offset && offset+1 < entries->length (), " oob-1" );
107
- // do not bother to copy u2 data; just overlay the struct within the array
108
- BSMAttributeEntry* bsme = ( BSMAttributeEntry*) entries->adr_at (offset);
109
- assert (offset+1 +bsme->argument_count () <= entries->length (), " oob-2" );
107
+ // Overlay the struct within the array
108
+ BSMAttributeEntry* bsme = reinterpret_cast < BSMAttributeEntry*>( entries->adr_at (offset) );
109
+ assert (offset+1 +bsme->argument_count () < entries->length (), " oob-2" );
110
110
return bsme;
111
111
}
112
112
friend class ConstantPool ; // uses entry_at_offset
You can’t perform that action at this time.
0 commit comments