8341277: Validate slot argument for instruction factories

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-10-02 03:30:02 +00:00
parent 0f381137cb
commit 39c17b3926
15 changed files with 366 additions and 80 deletions

View file

@ -92,6 +92,7 @@ public sealed interface LocalVariable extends PseudoInstruction
* @param descriptorEntry the local variable descriptor
* @param startScope the start range of the local variable scope
* @param endScope the end range of the local variable scope
* @throws IllegalArgumentException if {@code slot} is out of range
*/
static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope) {
return new AbstractPseudoInstruction.UnboundLocalVariable(slot, nameEntry, descriptorEntry,
@ -106,6 +107,7 @@ public sealed interface LocalVariable extends PseudoInstruction
* @param descriptor the local variable descriptor
* @param startScope the start range of the local variable scope
* @param endScope the end range of the local variable scope
* @throws IllegalArgumentException if {@code slot} is out of range
*/
static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) {
return of(slot,