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

32-bit integer log2 functions return the wrong value for negative arguments on 64-bit machines

XMLWordPrintable

    • b15
    • generic
    • generic

      log2_int() should return 32 for all negative arguments: the intention is to find the most significant set bit in x.

      This does not work on 64-bit machines because the argument is sign extended to 64 bits before being converted to uintptr_t.

            aph Andrew Haley
            aph Andrew Haley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: