As far as I understood the JVM bytecode specification,
aload index
pushes a reference found at index
onto the current stackframe. In my case, I need to aload
a reference found at an index which is stored in a local variable - something like this: aload (iload 2)
.
(How) Is this possible?
This is not possible. Otherwise verifier would not be able to prove the correctness of the bytecode.
To access values by index use array objects with the corresponding bytecodes, e.g. aaload
.