digi-scrypt opened a new pull request, #499: URL: https://github.com/apache/commons-bcel/pull/499
1. initFromFile reads matchLength, then sets the instruction length to matchLength + padding. 2. that should be fixedLength + padding, where fixedLength is 9 + matchLength * 8, so a freshly read LOOKUPSWITCH reports a length much smaller than the bytes it actually spans (a 2-pair switch consumes 28 bytes but getLength() returns 5). TABLESWITCH.initFromFile already does fixedLength + padding; changed LOOKUPSWITCH to match. What happens if a caller reads getLength() before setPositions() runs is the part that bit me here. Added a test that reads a LOOKUPSWITCH and checks getLength() equals the consumed byte count. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
