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

1.1.x: 64 bit versus 32 bit compatibility issue in src/share/java/lang/object.c

XMLWordPrintable

    • sparc
    • solaris_2.5.1

      JDK1.1.x - The change is in function
      java_lang_Object_wait in src/share/java/lang/object.c .
      The change is that INT_MAX should be passed to int2ll, not LONG_MAX.
      The change is needed because monitorWait() takes 32 bit int's as input.

      Below is the corrected code. The change is in the last line.


      java_lang_Object_wait(JHandle *p, int64_t millis)
      {
          int ms;

          if (ll_ltz(millis)) {
              SignalError(0, JAVAPKG "IllegalArgumentException",
                          "timeout value is negative");
              return;
          }

          /*
           * monitorWait() takes a C long, not a long long. We could redo
           * that to take a 64-bit integer, but that breaks the JIT interface
           * and doesn't seem very motivated. So we truncate.
           */
          if (ll_lt(millis, int2ll(INT_MAX))) { /*** HDS change LONG_MAX to INT_MAX
       ***/

            never Tom Rodriguez
            jbenoit Jonathan Benoit (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: