During the first pass through bytecode verifier builds an instruction array of the method. While building the instruction array verifier checks constraints for each processed instruction. For instance, for instruction working with local variables verifier checks a range of local variable index, for constant pool index – range of constant pool index and type of constant pool entry, and so on.
Java VM Specification has a limitation for arrays dimensions (it's limited to 255). There are 2 instructions which create multi-dimensional arrays – anewarray and multianewarray. The limitation should be checked for these instructions. Checking it verifier constructs a type of created array and counts a number of dimensions and check the limit. Besides array dimensions Java VM Specification has a limit for number of a method arguments (the limitation is 255 arguments). Parsing a descriptor of an invoked method verifier counts the number of arguments and checks if it exceeds the limit. The test which checks the limitations seems to be quite synthetic but verifier should be able to correctly process all classes loaded by VM. On 06/07/06, Pavel Rebriy (JIRA) <[EMAIL PROTECTED]> wrote:
[ http://issues.apache.org/jira/browse/HARMONY-788?page=all ] Pavel Rebriy updated HARMONY-788: --------------------------------- Attachment: 0001-Verifier-parameters-and-dimensions-limit-checks-fix.patch Patch to fix the problem. > [drlvm] Verifier: parameters and dimensions limit checks fix > ------------------------------------------------------------ > > Key: HARMONY-788 > URL: http://issues.apache.org/jira/browse/HARMONY-788 > Project: Harmony > Type: Bug > Components: VM > Reporter: Pavel Rebriy > Attachments: 0001-Test.zip, 0001-Verifier-parameters-and-dimensions-limit-checks-fix.patch > > I've found a bug that DRLVM verifier doesn't check array dimensions and method parameters limits as requested in Java VM Specification. > Test checks multianewarray instruction array dimensions and number of arguments for invokevirtual, invokespecial, invokeinterface and invokestatic instructions. > To run test use the following command: > <path to drl vm>/bin/ij Test -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
-- Best regards, Pavel Rebriy