Skip to content

Commit

Permalink
Merge pull request #5079 from ChengJin01/bcv_stack_size_stakmap_stati…
Browse files Browse the repository at this point in the history
…c_v0.13

Check the stack size of a stackmap frame (v0.13)
  • Loading branch information
DanHeidinga authored Mar 13, 2019
2 parents 6860f3b + 3ee7f8d commit a4ab003
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/bcverify/staticverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,12 @@ checkStackMap (J9CfrClassFile* classfile, J9CfrMethod * method, J9CfrAttributeCo
slotCount = 0;
if ((frameType >= CFR_STACKMAP_SAME_LOCALS_1_STACK) && (frameType <= CFR_STACKMAP_SAME_LOCALS_1_STACK_EXTENDED)) {
slotCount = 1;

/* The stackmap entry is invalid if the size of stack (1 slot) exceeds the size of the max stack.*/
if (code->maxStack < slotCount) {
errorCode = FATAL_CLASS_FORMAT_ERROR;
goto _failedCheck;
}
}
if (frameType >= CFR_STACKMAP_CHOP_3) {
slotCount = (IDATA) frameType - CFR_STACKMAP_APPEND_BASE;
Expand Down

0 comments on commit a4ab003

Please sign in to comment.