8244548: JDK 8u: sun.misc.Version.jdkUpdateVersion() returns wrong result

Wed, 06 May 2020 21:03:44 +0200

author
sgehwolf
date
Wed, 06 May 2020 21:03:44 +0200
changeset 9915
26ffadc256e1
parent 9914
d99632e69372
child 9916
545fe7caa2fb

8244548: JDK 8u: sun.misc.Version.jdkUpdateVersion() returns wrong result
Reviewed-by: aph, andrew

src/share/vm/prims/jvm.h file | annotate | diff | comparison | revisions
src/share/vm/runtime/java.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/prims/jvm.h	Fri Feb 28 15:33:44 2020 +0100
     1.2 +++ b/src/share/vm/prims/jvm.h	Wed May 06 21:03:44 2020 +0200
     1.3 @@ -1628,9 +1628,9 @@
     1.4  } jvm_version_info;
     1.5  
     1.6  #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
     1.7 -#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
     1.8 +#define JVM_VERSION_MINOR(version) ((version & 0x00FFFF00) >> 8)
     1.9  // Micro version is 0 in HotSpot Express VM (set in jvm.cpp).
    1.10 -#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
    1.11 +#define JVM_VERSION_MICRO(version) 0
    1.12  /* Build number is available in all HotSpot Express VM builds.
    1.13   * It is defined in make/hotspot_version file.
    1.14   */
    1.15 @@ -1643,9 +1643,9 @@
    1.16      // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx
    1.17      unsigned int jdk_version;   /* Consists of major, minor, micro (n.n.n) */
    1.18                                  /* and build number (xx) */
    1.19 -    unsigned int update_version : 8;         /* Update release version (uu) */
    1.20 +    unsigned int update_version : 16;        /* Update release version (uu) */
    1.21      unsigned int special_update_version : 8; /* Special update release version (c)*/
    1.22 -    unsigned int reserved1 : 16;
    1.23 +    unsigned int reserved1 : 8;
    1.24      unsigned int reserved2;
    1.25  
    1.26      /* The following bits represents new JDK supports that VM has dependency on.
     2.1 --- a/src/share/vm/runtime/java.hpp	Fri Feb 28 15:33:44 2020 +0100
     2.2 +++ b/src/share/vm/runtime/java.hpp	Wed May 06 21:03:44 2020 +0200
     2.3 @@ -85,7 +85,7 @@
     2.4    uint8_t _major;
     2.5    uint8_t _minor;
     2.6    uint8_t _micro;
     2.7 -  uint8_t _update;
     2.8 +  uint16_t _update;
     2.9    uint8_t _special;
    2.10    uint8_t _build;
    2.11  
    2.12 @@ -121,7 +121,7 @@
    2.13                    _pending_list_uses_discovered_field(false) {}
    2.14  
    2.15    JDK_Version(uint8_t major, uint8_t minor = 0, uint8_t micro = 0,
    2.16 -              uint8_t update = 0, uint8_t special = 0, uint8_t build = 0,
    2.17 +              uint16_t update = 0, uint8_t special = 0, uint8_t build = 0,
    2.18                bool thread_park_blocker = false, bool post_vm_init_hook_enabled = false,
    2.19                bool pending_list_uses_discovered_field = false) :
    2.20        _major(major), _minor(minor), _micro(micro), _update(update),
    2.21 @@ -145,7 +145,7 @@
    2.22    uint8_t major_version() const          { return _major; }
    2.23    uint8_t minor_version() const          { return _minor; }
    2.24    uint8_t micro_version() const          { return _micro; }
    2.25 -  uint8_t update_version() const         { return _update; }
    2.26 +  uint16_t update_version() const        { return _update; }
    2.27    uint8_t special_update_version() const { return _special; }
    2.28    uint8_t build_number() const           { return _build; }
    2.29  
     3.1 --- a/src/share/vm/runtime/vm_version.cpp	Fri Feb 28 15:33:44 2020 +0100
     3.2 +++ b/src/share/vm/runtime/vm_version.cpp	Wed May 06 21:03:44 2020 +0200
     3.3 @@ -283,7 +283,7 @@
     3.4  
     3.5  unsigned int Abstract_VM_Version::jvm_version() {
     3.6    return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
     3.7 -         ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
     3.8 +         ((Abstract_VM_Version::vm_minor_version() & 0xFFFF) << 8) |
     3.9           (Abstract_VM_Version::vm_build_number() & 0xFF);
    3.10  }
    3.11  

mercurial