Skip to content

Commit a557fd8

Browse files
Kim Barrettpull[bot]
authored andcommitted
8337523: Fix -Wzero-as-null-pointer-constant warnings in jvmci code
Reviewed-by: chagedorn, shade
1 parent 0f85bd0 commit a557fd8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 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
@@ -664,7 +664,7 @@ JVMCI::CodeInstallResult CodeInstaller::install_runtime_stub(CodeBlob*& cb,
664664
GrowableArray<RuntimeStub*> *stubs_to_free = nullptr;
665665
#ifdef ASSERT
666666
const char* val = Arguments::PropertyList_get_value(Arguments::system_properties(), "test.jvmci.forceRuntimeStubAllocFail");
667-
if (val != nullptr && strstr(name , val) != 0) {
667+
if (val != nullptr && strstr(name , val) != nullptr) {
668668
stubs_to_free = new GrowableArray<RuntimeStub*>();
669669
JVMCI_event_1("forcing allocation of %s in code cache to fail", name);
670670
}

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ C2V_VMENTRY_NULL(jobject, getResolvedJavaMethod, (JNIEnv* env, jobject, jobject
424424

425425
C2V_VMENTRY_NULL(jobject, getConstantPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(klass_or_method), jboolean is_klass))
426426
ConstantPool* cp = nullptr;
427-
if (UNPACK_PAIR(address, klass_or_method) == 0) {
427+
if (UNPACK_PAIR(address, klass_or_method) == nullptr) {
428428
JVMCI_THROW_NULL(NullPointerException);
429429
}
430430
if (!is_klass) {
@@ -1098,7 +1098,7 @@ C2V_END
10981098

10991099
C2V_VMENTRY_0(jlong, getMaxCallTargetOffset, (JNIEnv* env, jobject, jlong addr))
11001100
address target_addr = (address) addr;
1101-
if (target_addr != 0x0) {
1101+
if (target_addr != nullptr) {
11021102
int64_t off_low = (int64_t)target_addr - ((int64_t)CodeCache::low_bound() + sizeof(int));
11031103
int64_t off_high = (int64_t)target_addr - ((int64_t)CodeCache::high_bound() + sizeof(int));
11041104
return MAX2(ABS(off_low), ABS(off_high));

src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
240240
cardtable_shift = CardTable::card_shift();
241241
} else {
242242
// No card mark barriers
243-
cardtable_start_address = 0;
243+
cardtable_start_address = nullptr;
244244
cardtable_shift = 0;
245245
}
246246

src/hotspot/share/jvmci/jvmciRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ JRT_LEAF(oopDesc*, JVMCIRuntime::load_and_clear_exception(JavaThread* thread))
628628
oop exception = thread->exception_oop();
629629
assert(exception != nullptr, "npe");
630630
thread->set_exception_oop(nullptr);
631-
thread->set_exception_pc(0);
631+
thread->set_exception_pc(nullptr);
632632
return exception;
633633
JRT_END
634634

0 commit comments

Comments
 (0)