Skip to content

Commit 7d6a2f3

Browse files
8342860: Fix more NULL usage backsliding
Reviewed-by: kbarrett, jwaters, tschatzl, jsjolen
1 parent f6edfe5 commit 7d6a2f3

File tree

13 files changed

+32
-32
lines changed

13 files changed

+32
-32
lines changed

src/hotspot/os/aix/os_aix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static void query_multipage_support() {
468468

469469
// Can we use mmap with 64K pages? (Should be available with AIX7.3 TL1)
470470
{
471-
void* p = mmap(NULL, 64*K, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
471+
void* p = mmap(nullptr, 64*K, PROT_READ | PROT_WRITE, MAP_ANON_64K | MAP_ANONYMOUS | MAP_SHARED, -1, 0);
472472
assert(p != (void*) -1, "mmap failed");
473473
if (p != (void*) -1) {
474474
g_multipage_support.can_use_64K_mmap_pages = (64*K == os::Aix::query_pagesize(p));

src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@ static bool find_ro_opt(char* mount_opts) {
167167
char* token;
168168
char* mo_ptr = mount_opts;
169169
// mount options are comma-separated (man proc).
170-
while ((token = strsep(&mo_ptr, ",")) != NULL) {
170+
while ((token = strsep(&mo_ptr, ",")) != nullptr) {
171171
if (strcmp(token, "ro") == 0) {
172172
return true;
173173
}

src/hotspot/os/posix/os_posix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ void* os::dll_lookup(void* handle, const char* name) {
816816
void* ret = ::dlsym(handle, name);
817817
if (ret == nullptr) {
818818
const char* tmp = ::dlerror();
819-
// It is possible that we found a NULL symbol, hence no error.
819+
// It is possible that we found a null symbol, hence no error.
820820
if (tmp != nullptr) {
821821
log_debug(os)("Symbol %s not found in dll: %s", name, tmp);
822822
}

src/hotspot/os/windows/os_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4150,7 +4150,7 @@ void getWindowsInstallationType(char* buffer, int bufferSize) {
41504150
}
41514151

41524152
// Query the value
4153-
if (RegQueryValueExA(hKey, valueName, NULL, NULL, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) {
4153+
if (RegQueryValueExA(hKey, valueName, nullptr, nullptr, (LPBYTE)buffer, &valueLength) != ERROR_SUCCESS) {
41544154
RegCloseKey(hKey);
41554155
buffer[0] = '\0';
41564156
return;

src/hotspot/share/classfile/classLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ static char decode_percent_encoded(const char *str, size_t& index) {
12421242
hex[1] = str[index + 2];
12431243
hex[2] = '\0';
12441244
index += 2;
1245-
return (char) strtol(hex, NULL, 16);
1245+
return (char) strtol(hex, nullptr, 16);
12461246
}
12471247
return str[index];
12481248
}

src/hotspot/share/include/cds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef struct CDSFileMapRegion {
6969
size_t _ptrmap_offset; // Bitmap for relocating native pointer fields in archived heap objects.
7070
// (The base address is the bottom of the BM region).
7171
size_t _ptrmap_size_in_bits;
72-
char* _mapped_base; // Actually mapped address (NULL if this region is not mapped).
72+
char* _mapped_base; // Actually mapped address (null if this region is not mapped).
7373
} CDSFileMapRegion;
7474

7575
// This portion of the archive file header must remain unchanged for

src/hotspot/share/include/jvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
419419

420420

421421
/*
422-
* Find a class from a boot class loader. Returns NULL if class not found.
422+
* Find a class from a boot class loader. Returns null if class not found.
423423
*/
424424
JNIEXPORT jclass JNICALL
425425
JVM_FindClassFromBootLoader(JNIEnv *env, const char *name);

src/hotspot/share/oops/constantPool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ void ConstantPool::remove_resolved_klass_if_non_deterministic(int cp_index) {
477477
if (k == nullptr) {
478478
// We'd come here if the referenced class has been excluded via
479479
// SystemDictionaryShared::is_excluded_class(). As a result, ArchiveBuilder
480-
// has cleared the resolved_klasses()->at(...) pointer to NULL. Thus, we
480+
// has cleared the resolved_klasses()->at(...) pointer to null. Thus, we
481481
// need to revert the tag to JVM_CONSTANT_UnresolvedClass.
482482
can_archive = false;
483483
} else {

src/hotspot/share/opto/escape.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ bool ConnectionGraph::can_reduce_phi(PhiNode* ophi) const {
644644
//
645645
// 'curr_ctrl' is the control of the CastPP that we want to split through phi.
646646
// If the CastPP currently doesn't have a control then the CmpP/N will be
647-
// against the NULL constant, otherwise it will be against the constant input of
647+
// against the null constant, otherwise it will be against the constant input of
648648
// the existing CmpP/N. It's guaranteed that there will be a CmpP/N in the later
649649
// case because we have constraints on it and because the CastPP has a control
650650
// input.
@@ -672,7 +672,7 @@ Node* ConnectionGraph::specialize_cmp(Node* base, Node* curr_ctrl) {
672672
// means that the CastPP now will be specific for a given base instead of a Phi.
673673
// An If-Then-Else-Region block is inserted to control the CastPP. The control
674674
// of the CastPP is a copy of the current one (if there is one) or a check
675-
// against NULL.
675+
// against null.
676676
//
677677
// Before:
678678
//
@@ -806,10 +806,10 @@ Node* ConnectionGraph::split_castpp_load_through_phi(Node* curr_addp, Node* curr
806806
// After splitting the CastPP we'll put it under an If-Then-Else-Region control
807807
// flow. If the CastPP originally had an IfTrue/False control input then we'll
808808
// use a similar CmpP/N to control the new If-Then-Else-Region. Otherwise, we'll
809-
// juse use a CmpP/N against the NULL constant.
809+
// juse use a CmpP/N against the null constant.
810810
//
811811
// The If-Then-Else-Region isn't always needed. For instance, if input to
812-
// splitted cast was not nullable (or if it was the NULL constant) then we don't
812+
// splitted cast was not nullable (or if it was the null constant) then we don't
813813
// need (shouldn't) use a CastPP at all.
814814
//
815815
// After the casts are splitted we'll split the AddP->Loads through the Phi and
@@ -837,7 +837,7 @@ Node* ConnectionGraph::split_castpp_load_through_phi(Node* curr_addp, Node* curr
837837
//
838838
// After (Very much simplified):
839839
//
840-
// Call NULL
840+
// Call Null
841841
// \ /
842842
// CmpP
843843
// |
@@ -873,7 +873,7 @@ void ConnectionGraph::reduce_phi_on_castpp_field_load(Node* curr_castpp, Growabl
873873
// array, depending on the nullability status of the corresponding input in
874874
// ophi.
875875
//
876-
// - nullptr: Meaning that the base is actually the NULL constant and therefore
876+
// - nullptr: Meaning that the base is actually the null constant and therefore
877877
// we won't try to load from it.
878878
//
879879
// - CFG Node: Meaning that the base is a CastPP that was specialized for
@@ -890,7 +890,7 @@ void ConnectionGraph::reduce_phi_on_castpp_field_load(Node* curr_castpp, Growabl
890890

891891
if (base_t->maybe_null()) {
892892
if (base->is_Con()) {
893-
// Nothing todo as bases_for_loads[i] is already nullptr
893+
// Nothing todo as bases_for_loads[i] is already null
894894
} else {
895895
Node* new_castpp = specialize_castpp(curr_castpp, base, ophi->in(0)->in(i));
896896
bases_for_loads.at_put(i, new_castpp->in(0)); // Use the ctrl of the new node just as a flag

src/hotspot/share/opto/library_call.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7750,11 +7750,11 @@ bool LibraryCallKit::inline_intpoly_montgomeryMult_P256() {
77507750
r = must_be_not_null(r, true);
77517751

77527752
Node* a_start = array_element_address(a, intcon(0), T_LONG);
7753-
assert(a_start, "a array is NULL");
7753+
assert(a_start, "a array is null");
77547754
Node* b_start = array_element_address(b, intcon(0), T_LONG);
7755-
assert(b_start, "b array is NULL");
7755+
assert(b_start, "b array is null");
77567756
Node* r_start = array_element_address(r, intcon(0), T_LONG);
7757-
assert(r_start, "r array is NULL");
7757+
assert(r_start, "r array is null");
77587758

77597759
Node* call = make_runtime_call(RC_LEAF | RC_NO_FP,
77607760
OptoRuntime::intpoly_montgomeryMult_P256_Type(),
@@ -7779,9 +7779,9 @@ bool LibraryCallKit::inline_intpoly_assign() {
77797779
b = must_be_not_null(b, true);
77807780

77817781
Node* a_start = array_element_address(a, intcon(0), T_LONG);
7782-
assert(a_start, "a array is NULL");
7782+
assert(a_start, "a array is null");
77837783
Node* b_start = array_element_address(b, intcon(0), T_LONG);
7784-
assert(b_start, "b array is NULL");
7784+
assert(b_start, "b array is null");
77857785

77867786
Node* call = make_runtime_call(RC_LEAF | RC_NO_FP,
77877787
OptoRuntime::intpoly_assign_Type(),

0 commit comments

Comments
 (0)