Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8341288

Validate slot argument for instruction factories

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-libs
    • None
    • behavioral
    • low
    • Preexisting users usually can discover these issues when they encounter inconsistencies in produced class files. These permissive behavior is believed not to be depend on as Class-File API is still new.
    • Java API
    • SE

      Summary

      Validate the local variable slot argument, multinewarray dimensions argument, and iinc value arguments and specify such validation.

      Problem

      Currently, local variable slot, multinewarray dimensions, and iinc value are all modeled by plain int values. They are not range-checked upon passing into factory methods. Therefore, the created model objects can have illegal values not representable in the class file format, or not allowed by the JVMS.

      Solution

      Perform range checks on these 3 selected type of arguments and specify that range checks are performed. This is better than allowing such values to be lost in the writing of class files, or to be passed to downstream class file transformations.

      Specification

      See the attached diff.

            liach Chen Liang
            liach Chen Liang
            Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: