src/share/vm/classfile/verifier.cpp

changeset 8674
72a298cbc071
parent 8570
e4525db27263
child 8604
04d83ba48607
child 8676
b4b7e6bb414d
     1.1 --- a/src/share/vm/classfile/verifier.cpp	Tue Jul 05 14:40:55 2016 -0700
     1.2 +++ b/src/share/vm/classfile/verifier.cpp	Thu Jun 30 08:11:30 2016 -0400
     1.3 @@ -504,8 +504,19 @@
     1.4      stack_map_frame* sm_frame = sm_table->entries();
     1.5      streamIndentor si2(ss);
     1.6      int current_offset = -1;
     1.7 +    // Subtract two from StackMapAttribute length because the length includes
     1.8 +    // two bytes for number of table entries.
     1.9 +    size_t sm_table_space = method->stackmap_data()->length() - 2;
    1.10      for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
    1.11        ss->indent();
    1.12 +      size_t sm_frame_size = sm_frame->size();
    1.13 +      // If the size of the next stackmap exceeds the length of the entire
    1.14 +      // stackmap table then print a truncated message and return.
    1.15 +      if (sm_frame_size > sm_table_space) {
    1.16 +        sm_frame->print_truncated(ss, current_offset);
    1.17 +        return;
    1.18 +      }
    1.19 +      sm_table_space -= sm_frame_size;
    1.20        sm_frame->print_on(ss, current_offset);
    1.21        ss->cr();
    1.22        current_offset += sm_frame->offset_delta();

mercurial