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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 8u112, 9
    • 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);

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

              Created:
              Updated:
              Resolved: