Skip to content

Commit 0c1e911

Browse files
zifeihanRealFYang
authored andcommittedAug 9, 2024
8338019: Fix simple -Wzero-as-null-pointer-constant warnings in riscv code
Reviewed-by: fyang, mli, luhenry
1 parent 55c5097 commit 0c1e911

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
542542
insn = &MacroAssembler::sw; break;
543543
case T_OBJECT: // fall through
544544
case T_ARRAY:
545-
assert(c->as_jobject() == 0, "should be");
545+
assert(c->as_jobject() == nullptr, "should be");
546546
if (UseCompressedOops && !wide) {
547547
insn = &MacroAssembler::sw;
548548
} else {

‎src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1066,4 +1066,4 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
10661066

10671067
#undef __
10681068

1069-
const char *Runtime1::pd_name_for_address(address entry) { Unimplemented(); return 0; }
1069+
const char *Runtime1::pd_name_for_address(address entry) { Unimplemented(); }

‎src/hotspot/cpu/riscv/frame_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void frame::patch_pc(Thread* thread, address pc) {
269269

270270
// Either the return address is the original one or we are going to
271271
// patch in the same address that's already there.
272-
assert(_pc == pc_old || pc == pc_old || pc_old == 0, "must be");
272+
assert(_pc == pc_old || pc == pc_old || pc_old == nullptr, "must be");
273273
DEBUG_ONLY(address old_pc = _pc;)
274274
*pc_addr = pc;
275275
_pc = pc; // must be set before call to get_deopt_original_pc

‎src/hotspot/cpu/riscv/nativeInst_riscv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ address NativeJump::jump_destination() const {
685685
// load
686686

687687
// return -1 if jump to self or to 0
688-
if ((dest == (address) this) || dest == 0) {
688+
if ((dest == (address) this) || dest == nullptr) {
689689
dest = (address) -1;
690690
}
691691

@@ -714,7 +714,7 @@ address NativeGeneralJump::jump_destination() const {
714714
// a general jump
715715

716716
// return -1 if jump to self or to 0
717-
if ((dest == (address) this) || dest == 0) {
717+
if ((dest == (address) this) || dest == nullptr) {
718718
dest = (address) -1;
719719
}
720720

0 commit comments

Comments
 (0)
Please sign in to comment.