Implement checks to verify if we exceeded the max constant for a given index size. #13
Closed
2 tasks done
Labels
bug
Something isn't working
component:compiler
This issue is related to the Compiler and/or Bytecode.
enhancement
New feature or request
Milestone
Throughout the bytecode, integers of multiple sizes (12 bits, 16 bits and 24 bits) are used to index values on constant pools. However, the compiler does not care if a given constant is over the index's size in bits, and invalid bytecode will be generated in this case.
Notable cases:
InvokeLocalInsn/InvokeMemberInsn
uses a 16-bits integer#nameConst
to index the string pool, whereas the rest of the code uses 24-bits integers.PushExceptionHandlingInsn
/PushLoopHandlingInsn
uses a pair of 12-bits integer (don't judge, size constraints) to index two labels, whereasJumpInsn
uses a 24-bit integer.Implement checks to verify if a given compilation exceeds either the absolute maximum constant size.
Reduce the integer used in constant pools/function definitions size to 24-bit integers.
The text was updated successfully, but these errors were encountered: