Fix broken sourcefile_attribute_parser#38
Conversation
Remove parsing of attribute_name_index and attribute_length from sourcefile_attribute_parser. These fields don't need to be parsed here.
|
Doesn't this differ from the spec? https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.10 Which says the |
|
It should not. This implementation works with a Java 8 compiler and also a Java 21 compiler. Also, it seems to be that all other attribute parsers don't parse the first to fields to. For example: classfile-parser/src/attribute_info/parser.rs Lines 46 to 50 in fefca09 Yes, it is weird that it is in the specification but does not need to be parsed here. At this point, I don't know why I don't have to parse these... And if I try, to parse then it errors. |
|
Name and length get parsed generically for all attributes here: classfile-parser/src/attribute_info/parser.rs Lines 16 to 19 in fefca09 So the individual attribute parsers don't need to parse it themselves. So your change is correct, good spot 👍 |
Remove parsing of attribute_name_index and attribute_length from sourcefile_attribute_parser.
These fields don't need to be parsed here.