Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/verifier.cpp @ 23962:e4525db27263 jdk8u111-b05
8159511: Stack map validation
Reviewed-by: acorn, mschoene
Contributed-by: harold.seigel@oracle.com
author | hseigel |
---|---|
date | Thu, 30 Jun 2016 08:11:30 -0400 |
parents | 0095e54dcaa1 |
children | f13e777eb255 b4b7e6bb414d |
comparison
equal
deleted
inserted
replaced
23961:0cdf9eb633c4 | 23962:e4525db27263 |
---|---|
502 stack_map_table* sm_table = | 502 stack_map_table* sm_table = |
503 stack_map_table::at((address)data->adr_at(0)); | 503 stack_map_table::at((address)data->adr_at(0)); |
504 stack_map_frame* sm_frame = sm_table->entries(); | 504 stack_map_frame* sm_frame = sm_table->entries(); |
505 streamIndentor si2(ss); | 505 streamIndentor si2(ss); |
506 int current_offset = -1; | 506 int current_offset = -1; |
507 // Subtract two from StackMapAttribute length because the length includes | |
508 // two bytes for number of table entries. | |
509 size_t sm_table_space = method->stackmap_data()->length() - 2; | |
507 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { | 510 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { |
508 ss->indent(); | 511 ss->indent(); |
512 size_t sm_frame_size = sm_frame->size(); | |
513 // If the size of the next stackmap exceeds the length of the entire | |
514 // stackmap table then print a truncated message and return. | |
515 if (sm_frame_size > sm_table_space) { | |
516 sm_frame->print_truncated(ss, current_offset); | |
517 return; | |
518 } | |
519 sm_table_space -= sm_frame_size; | |
509 sm_frame->print_on(ss, current_offset); | 520 sm_frame->print_on(ss, current_offset); |
510 ss->cr(); | 521 ss->cr(); |
511 current_offset += sm_frame->offset_delta(); | 522 current_offset += sm_frame->offset_delta(); |
512 sm_frame = sm_frame->next(); | 523 sm_frame = sm_frame->next(); |
513 } | 524 } |