The use of strict fields in constructors with control flow introduced the need for the early_larval stackmap frame type to track the state of strict field initialization. An early_larval frame contains a set of NameAndTypes which must be marked as unset but there are no checks to ensure the input values actually refer to a NameAndType.
If an invalid constant pool index or an index that does not refer to a NameAndType is present in an early_larval frame, the vm will crash.
An example from a jcod file:
Attr(#36) { // StackMapTable
[] { //
246b, []{#8; #0}, { // CRASH: early_larval_frame with CP index 0 which is invalid
21b; // same
};
246b, []{#3; #8}, { // early_larval_frame
7b; // same_frame
};
246b, []{}, { // early_larval_frame
9b; // same_frame
};
}
} // end of StackMapTable
If an invalid constant pool index or an index that does not refer to a NameAndType is present in an early_larval frame, the vm will crash.
An example from a jcod file:
Attr(#36) { // StackMapTable
[] { //
246b, []{#8; #0}, { // CRASH: early_larval_frame with CP index 0 which is invalid
21b; // same
};
246b, []{#3; #8}, { // early_larval_frame
7b; // same_frame
};
246b, []{}, { // early_larval_frame
9b; // same_frame
};
}
} // end of StackMapTable