Skip to content

Commit 431d4f7

Browse files
author
Kim Barrett
committed
8337785: Fix simple -Wzero-as-null-pointer-constant warnings in x86 code
Reviewed-by: jwaters, ayang, shade
1 parent e2c07d5 commit 431d4f7

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/hotspot/cpu/x86/frame_x86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void frame::patch_pc(Thread* thread, address pc) {
279279

280280
assert(!Continuation::is_return_barrier_entry(*pc_addr), "return barrier");
281281

282-
assert(_pc == *pc_addr || pc == *pc_addr || *pc_addr == 0, "");
282+
assert(_pc == *pc_addr || pc == *pc_addr || *pc_addr == nullptr, "");
283283
DEBUG_ONLY(address old_pc = _pc;)
284284
*pc_addr = pc;
285285
_pc = pc; // must be set before call to get_deopt_original_pc
@@ -483,10 +483,10 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
483483
bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
484484
assert(is_interpreted_frame(), "Not an interpreted frame");
485485
// These are reasonable sanity checks
486-
if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) {
486+
if (fp() == nullptr || (intptr_t(fp()) & (wordSize-1)) != 0) {
487487
return false;
488488
}
489-
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
489+
if (sp() == nullptr || (intptr_t(sp()) & (wordSize-1)) != 0) {
490490
return false;
491491
}
492492
if (fp() + interpreter_frame_initial_sp_offset < sp()) {

src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Intel Corporation. All rights reserved.
2+
* Copyright (c) 2016, 2024, Intel Corporation. All rights reserved.
33
*
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -689,7 +689,7 @@ void MacroAssembler::sha256_AVX2(XMMRegister msg, XMMRegister state0, XMMRegiste
689689

690690
address K256_W = StubRoutines::x86::k256_W_addr();
691691
address pshuffle_byte_flip_mask = StubRoutines::x86::pshuffle_byte_flip_mask_addr();
692-
address pshuffle_byte_flip_mask_addr = 0;
692+
address pshuffle_byte_flip_mask_addr = nullptr;
693693

694694
const XMMRegister& SHUF_00BA = xmm10; // ymm10: shuffle xBxA -> 00BA
695695
const XMMRegister& SHUF_DC00 = xmm12; // ymm12: shuffle xDxC -> DC00
@@ -1247,7 +1247,7 @@ void MacroAssembler::sha512_AVX2(XMMRegister msg, XMMRegister state0, XMMRegiste
12471247

12481248
address K512_W = StubRoutines::x86::k512_W_addr();
12491249
address pshuffle_byte_flip_mask_sha512 = StubRoutines::x86::pshuffle_byte_flip_mask_addr_sha512();
1250-
address pshuffle_byte_flip_mask_addr = 0;
1250+
address pshuffle_byte_flip_mask_addr = nullptr;
12511251

12521252
const XMMRegister& XFER = xmm0; // YTMP0
12531253
const XMMRegister& BYTE_FLIP_MASK = xmm9; // ymm9

src/hotspot/cpu/x86/methodHandles_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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
@@ -572,7 +572,7 @@ void trace_method_handle_stub(const char* adaptername,
572572

573573
frame cur_frame = os::current_frame();
574574

575-
if (cur_frame.fp() != 0) { // not walkable
575+
if (cur_frame.fp() != nullptr) { // not walkable
576576

577577
// Robust search of trace_calling_frame (independent of inlining).
578578
// Assumes saved_regs comes from a pusha in the trace_calling_frame.

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ const char* VM_Version::_features_names[] = { CPU_FEATURE_FLAGS(DECLARE_CPU_FEAT
5353
#undef DECLARE_CPU_FEATURE_FLAG
5454

5555
// Address of instruction which causes SEGV
56-
address VM_Version::_cpuinfo_segv_addr = 0;
56+
address VM_Version::_cpuinfo_segv_addr = nullptr;
5757
// Address of instruction after the one which causes SEGV
58-
address VM_Version::_cpuinfo_cont_addr = 0;
58+
address VM_Version::_cpuinfo_cont_addr = nullptr;
5959
// Address of instruction which causes APX specific SEGV
60-
address VM_Version::_cpuinfo_segv_addr_apx = 0;
60+
address VM_Version::_cpuinfo_segv_addr_apx = nullptr;
6161
// Address of instruction after the one which causes APX specific SEGV
62-
address VM_Version::_cpuinfo_cont_addr_apx = 0;
62+
address VM_Version::_cpuinfo_cont_addr_apx = nullptr;
6363

6464
static BufferBlob* stub_blob;
6565
static const int stub_size = 2000;

src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
224224
if (info != nullptr && uc != nullptr && thread != nullptr) {
225225
pc = (address) os::Posix::ucontext_get_pc(uc);
226226

227-
if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) {
227+
if (sig == SIGSEGV && info->si_addr == nullptr && info->si_code == SI_KERNEL) {
228228
// An irrecoverable SI_KERNEL SIGSEGV has occurred.
229229
// It's likely caused by dereferencing an address larger than TASK_SIZE.
230230
return false;

0 commit comments

Comments
 (0)