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

>>>=0 generates invalid bytecode for BaseNode LHS

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u112, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b148
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        The expression "a.b >>>=0" or "a[b] >>>=0" will leave a lingering "a" loaded on the operand stack when generating bytecode, in many cases throwing off stack maps and ultimately failing the verifier.

        This is specific to the >>>= operator, in case where the LHS is a base expression (property or element access) and the RHS is a literal zero.

        The bug is in a special-case handling of RHS zero (we have a special path for "coerce to UInt32, which is basically what >>>=0 is doing) that is not loading LHS with "base already on stack" flag set and thus resulting in an additional, unnecessary load of the base.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  attila Attila Szegedi
                  Reporter:
                  attila Attila Szegedi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: