rootvector2 commented on PR #504:
URL: https://github.com/apache/commons-bcel/pull/504#issuecomment-4730262031

   both already in good shape:
   
   1. the verifier enforces it. `Pass3aVerifier.visitMULTIANEWARRAY` rejects 
`getDimensions() < 1` with "Number of dimensions to create must be greater than 
zero." worth noting that before this fix that check misfired the other way: a 
valid `dimensions >= 128` read back negative and tripped the `< 1` branch, 
flagging legit bytecode. so the unsigned read also keeps that constraint 
honest. no extra code needed there.
   
   2. went through the other `initFromFile` overrides. the only other 
unsigned-byte operand still read with `readByte()` is `NEWARRAY` (`atype`), but 
the valid atype codes are 4-11 so it never sign-extends in practice, and it's 
stored in a `byte` field anyway. the remaining `readByte()` calls (`BIPUSH` 
operand, `IINC` increment) read operands the spec defines as signed, so those 
are correct. `multianewarray` was the odd one out: an unsigned operand widened 
into a larger signed field.


-- 
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]

Reply via email to