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

   the wide form. plain `iinc` takes a signed byte, but `setWide()` upgrades 
the instruction to `wide iinc` whenever the increment doesn't fit in a byte, 
and `dump` then writes it with `writeShort`. per [JVMS 6.5 
wide](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.wide)
 (format 2) the extended const is a signed 16-bit value, so that's the widest 
range `IINC` can encode. the byte bound needs no guard since the upgrade to 
wide is automatic; past the short bound `writeShort` truncates, which is how 
`new IINC(0, 40000)` ends up dumping an increment of `-25536`.


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