Skip to content

Commit 5bcaf10

Browse files
author
duke
committedSep 25, 2024
Automatic merge of jdk:master into master
2 parents c5c5502 + 9bcc7b6 commit 5bcaf10

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ private static Type cpIndexToType(int index, ConstantPoolBuilder cp) {
400400
}
401401

402402
private void processMethod() {
403+
var frames = this.frames;
404+
var currentFrame = this.currentFrame;
403405
currentFrame.setLocalsFromArg(methodName, methodDesc, isStatic, thisType);
404406
currentFrame.stackSize = 0;
405407
currentFrame.flags = 0;
@@ -415,10 +417,10 @@ private void processMethod() {
415417
throw generatorError("Expecting a stack map frame");
416418
}
417419
if (thisOffset == bcs.bci()) {
420+
Frame nextFrame = frames.get(stackmapIndex++);
418421
if (!ncf) {
419-
currentFrame.checkAssignableTo(frames.get(stackmapIndex));
422+
currentFrame.checkAssignableTo(nextFrame);
420423
}
421-
Frame nextFrame = frames.get(stackmapIndex++);
422424
while (!nextFrame.dirty) { //skip unmatched frames
423425
if (stackmapIndex == frames.size()) return; //skip the rest of this round
424426
nextFrame = frames.get(stackmapIndex++);
@@ -429,7 +431,7 @@ private void processMethod() {
429431
currentFrame.copyFrom(nextFrame);
430432
nextFrame.dirty = false;
431433
} else if (thisOffset < bcs.bci()) {
432-
throw new ClassFormatError(String.format("Bad stack map offset %d", thisOffset));
434+
throw generatorError("Bad stack map offset");
433435
}
434436
} else if (ncf) {
435437
throw generatorError("Expecting a stack map frame");

0 commit comments

Comments
 (0)
Please sign in to comment.