SA: Check and fix cases of potential data loss due to 'long' to 'int' truncation with calls to minus()

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • tbd
    • Affects Version/s: 8u112, 9
    • Component/s: hotspot
    • None

      The minus() methods in the platform specific address classes return values of type 'long'. But there are multiple areas where these return values are read into values of type 'int', with deliberate casts, thus causing potential loss of data.

      An example:
      share/classes/sun/jvm/hotspot/asm/Disassembler.java

      48 public static void decode(InstructionVisitor visitor, CodeBlob blob, Address begin , Address end) {
      49 int codeSize = (int)end.minus(begin);

            Assignee:
            Unassigned
            Reporter:
            Jini George (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: