-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
Verified
JVMS 4.7.3 describes the code[] and code_length items in the Code attribute. No constraints are described on code[], and the reader is referred to 4.9. Simple enough.
code_length is a different story: there is one constraint in 4.7.3 - code_length>0 - and two constraints in 4.9 which you have to find for yourself - code_length!=0 and code_length<65536. This duplication is obtuse.
4.7.3 should say that code_length must be >0 and <65536. HotSpot enforces this during class loading. The constraints in 4.9.1 are inappropriate as that section describes verification, after class loading.
The same reasoning applies to the constraint that the code array must not be empty. It belongs in 4.7.3, not 4.9.1, because it's enforced during class loading.
code_length is a different story: there is one constraint in 4.7.3 - code_length>0 - and two constraints in 4.9 which you have to find for yourself - code_length!=0 and code_length<65536. This duplication is obtuse.
4.7.3 should say that code_length must be >0 and <65536. HotSpot enforces this during class loading. The constraints in 4.9.1 are inappropriate as that section describes verification, after class loading.
The same reasoning applies to the constraint that the code array must not be empty. It belongs in 4.7.3, not 4.9.1, because it's enforced during class loading.