In the 1/2 year since JDK-8327171 there have been a number of new uses of NULL introduced into HotSpot code.
egrep "[^[:alnum:]_]NULL([^[:alnum:]_]|$)" on {src,test}/hotspot was used to find these, with some known cases removed. (Some in globalDefinitions_xxx.hpp require more work, jvmti.{xml,xsl} are generating C code.)
These are all in comments, and should be using "null" instead of "NULL".
-----
src/hotspot/os/posix/os_posix.cpp:819: // It is possible that we found a NULL symbol, hence no error.
src/hotspot/share/oops/constantPool.cpp:480: // has cleared the resolved_klasses()->at(...) pointer to NULL. Thus, we
src/hotspot/share/opto/escape.cpp:648:// against the NULL constant, otherwise it will be against the constant input of
src/hotspot/share/opto/escape.cpp:676:// against NULL.
src/hotspot/share/opto/escape.cpp:810:// juse use a CmpP/N against the NULL constant.
src/hotspot/share/opto/escape.cpp:813:// splitted cast was not nullable (or if it was the NULL constant) then we don't
src/hotspot/share/opto/escape.cpp:841:// Call NULL
src/hotspot/share/opto/escape.cpp:877: // - nullptr: Meaning that the base is actually the NULL constant and therefore
-----
These are in comments, but the language is C. We probably want to use "null" here anyway.
-----
src/hotspot/share/include/jvm.h:422: * Find a class from a boot class loader. Returns NULL if class not found.
src/hotspot/share/include/cds.h:72: char* _mapped_base; // Actually mapped address (NULL if this region is not mapped).
-----
These are in string literals, and should be using "null" instead of "NULL".
-----
src/hotspot/share/opto/library_call.cpp:7777: assert(a_start, "a array is NULL");
src/hotspot/share/opto/library_call.cpp:7779: assert(b_start, "b array is NULL");
src/hotspot/share/opto/library_call.cpp:7781: assert(r_start, "r array is NULL");
src/hotspot/share/opto/library_call.cpp:7806: assert(a_start, "a array is NULL");
src/hotspot/share/opto/library_call.cpp:7808: assert(b_start, "b array is NULL");
-----
These are in code, and should be using "nullptr" instead of "NULL".
-----
src/hotspot/os/linux/cgroupSubsystem_linux.cpp:170: while ((token = strsep(&mo_ptr, ",")) != NULL) {
src/hotspot/os/windows/os_windows.cpp:4153: if (RegQueryValueExA(hKey, valueName, NULL, NULL, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) {
src/hotspot/os/aix/os_aix.cpp:471: void* p = mmap(NULL, 64*K, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
src/hotspot/share/classfile/classLoader.cpp:1245: return (char) strtol(hex, NULL, 16);
src/hotspot/share/services/diagnosticFramework.cpp:427: while (token != NULL) {
-----
egrep "[^[:alnum:]_]NULL([^[:alnum:]_]|$)" on {src,test}/hotspot was used to find these, with some known cases removed. (Some in globalDefinitions_xxx.hpp require more work, jvmti.{xml,xsl} are generating C code.)
These are all in comments, and should be using "null" instead of "NULL".
-----
src/hotspot/os/posix/os_posix.cpp:819: // It is possible that we found a NULL symbol, hence no error.
src/hotspot/share/oops/constantPool.cpp:480: // has cleared the resolved_klasses()->at(...) pointer to NULL. Thus, we
src/hotspot/share/opto/escape.cpp:648:// against the NULL constant, otherwise it will be against the constant input of
src/hotspot/share/opto/escape.cpp:676:// against NULL.
src/hotspot/share/opto/escape.cpp:810:// juse use a CmpP/N against the NULL constant.
src/hotspot/share/opto/escape.cpp:813:// splitted cast was not nullable (or if it was the NULL constant) then we don't
src/hotspot/share/opto/escape.cpp:841:// Call NULL
src/hotspot/share/opto/escape.cpp:877: // - nullptr: Meaning that the base is actually the NULL constant and therefore
-----
These are in comments, but the language is C. We probably want to use "null" here anyway.
-----
src/hotspot/share/include/jvm.h:422: * Find a class from a boot class loader. Returns NULL if class not found.
src/hotspot/share/include/cds.h:72: char* _mapped_base; // Actually mapped address (NULL if this region is not mapped).
-----
These are in string literals, and should be using "null" instead of "NULL".
-----
src/hotspot/share/opto/library_call.cpp:7777: assert(a_start, "a array is NULL");
src/hotspot/share/opto/library_call.cpp:7779: assert(b_start, "b array is NULL");
src/hotspot/share/opto/library_call.cpp:7781: assert(r_start, "r array is NULL");
src/hotspot/share/opto/library_call.cpp:7806: assert(a_start, "a array is NULL");
src/hotspot/share/opto/library_call.cpp:7808: assert(b_start, "b array is NULL");
-----
These are in code, and should be using "nullptr" instead of "NULL".
-----
src/hotspot/os/linux/cgroupSubsystem_linux.cpp:170: while ((token = strsep(&mo_ptr, ",")) != NULL) {
src/hotspot/os/windows/os_windows.cpp:4153: if (RegQueryValueExA(hKey, valueName, NULL, NULL, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) {
src/hotspot/os/aix/os_aix.cpp:471: void* p = mmap(NULL, 64*K, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
src/hotspot/share/classfile/classLoader.cpp:1245: return (char) strtol(hex, NULL, 16);
src/hotspot/share/services/diagnosticFramework.cpp:427: while (token != NULL) {
-----
- relates to
-
JDK-8343802 Prevent NULL usage backsliding
- Open
-
JDK-8327171 Fix more NULL usage backsliding
- Resolved
- links to
-
Commit(master) openjdk/jdk/7d6a2f37
-
Review(master) openjdk/jdk/21826