From: Paul Floyd Date: Sat, 8 Mar 2025 08:20:53 +0000 (+0100) Subject: Fix int to pointer warnings X-Git-Tag: VALGRIND_3_25_0~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df5c62e04c26c328276e78fcb3923d5508fb70b8;p=thirdparty%2Fvalgrind.git Fix int to pointer warnings and a minnor correction for a comment about ELF segment handling --- diff --git a/VEX/priv/host_riscv64_defs.c b/VEX/priv/host_riscv64_defs.c index f6137b55b..6296b2e7f 100644 --- a/VEX/priv/host_riscv64_defs.c +++ b/VEX/priv/host_riscv64_defs.c @@ -2353,7 +2353,7 @@ Int emit_RISCV64Instr(/*MB_MOD*/ Bool* is_profInc, ? disp_cp_chain_me_to_fastEP : disp_cp_chain_me_to_slowEP; - p = addr48_to_ireg_EXACTLY_18B(p, 5 /*x5/t0*/, (ULong)disp_cp_chain_me); + p = addr48_to_ireg_EXACTLY_18B(p, 5 /*x5/t0*/, (ULong)(HWord)disp_cp_chain_me); /* c.jalr 0(t0) */ p = emit_CR(p, 0b10, 0 /*x0/zero*/, 5 /*x5/t0*/, 0b1001); @@ -2405,7 +2405,7 @@ Int emit_RISCV64Instr(/*MB_MOD*/ Bool* is_profInc, } /* li t0, VG_(disp_cp_xindir) */ - p = imm64_to_ireg(p, 5 /*x5/t0*/, (ULong)disp_cp_xindir); + p = imm64_to_ireg(p, 5 /*x5/t0*/, (ULong)(HWord)disp_cp_xindir); /* c.jr 0(t0) */ p = emit_CR(p, 0b10, 0 /*x0/zero*/, 5 /*x5/t0*/, 0b1000); @@ -2479,7 +2479,7 @@ Int emit_RISCV64Instr(/*MB_MOD*/ Bool* is_profInc, p = imm64_to_ireg(p, 8 /*x8/s0*/, trcval); /* li t0, VG_(disp_cp_xassisted) */ - p = imm64_to_ireg(p, 5 /*x5/t0*/, (ULong)disp_cp_xassisted); + p = imm64_to_ireg(p, 5 /*x5/t0*/, (ULong)(HWord)disp_cp_xassisted); /* c.jr 0(t0) */ p = emit_CR(p, 0b10, 0 /*x0/zero*/, 5 /*x5/t0*/, 0b1000); @@ -2598,7 +2598,7 @@ VexInvalRange chainXDirect_RISCV64(VexEndness endness_host, UChar* p = place_to_chain; vassert(((HWord)p & 1) == 0); vassert(is_addr48_to_ireg_EXACTLY_18B(p, 5 /*x5/t0*/, - (ULong)disp_cp_chain_me_EXPECTED)); + (ULong)(HWord)disp_cp_chain_me_EXPECTED)); vassert(p[18] == 0x82 && p[19] == 0x92); /* And what we want to change it to is: @@ -2615,7 +2615,7 @@ VexInvalRange chainXDirect_RISCV64(VexEndness endness_host, The replacement has the same length as the original. */ - (void)addr48_to_ireg_EXACTLY_18B(p, 5 /*x5/t0*/, (ULong)place_to_jump_to); + (void)addr48_to_ireg_EXACTLY_18B(p, 5 /*x5/t0*/, (ULong)(HWord)place_to_jump_to); p[18] = 0x82; p[19] = 0x82; diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index 1dadbc72c..0c37ea100 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -3939,7 +3939,7 @@ Bool ML_(check_elf_and_get_rw_loads) ( Int fd, const HChar* filename, * VG_(di_notify_mmap): in some cases, the 2 NSegments will * have been merged and VG_(di_notify_mmap) only gets called * once. - * How to detect that the segments were be merged ? + * How to detect that the segments were merged ? * Logically, they will be merged if the first segment ends * at the beginning of the second segment: * Seg1 virtual address + Seg1 segment_size