]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix int to pointer warnings
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 8 Mar 2025 08:20:53 +0000 (09:20 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 8 Mar 2025 08:20:53 +0000 (09:20 +0100)
and a minnor correction for a comment about ELF segment handling

VEX/priv/host_riscv64_defs.c
coregrind/m_debuginfo/readelf.c

index f6137b55bcb123291b292815be494bf1bd248c62..6296b2e7fee339c04dbc3558531c515010da20bc 100644 (file)
@@ -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;
 
index 1dadbc72c5a53c6d140ce0f6f237adbfc54a4517..0c37ea100947d9d33360cde5c7d6761db68b2f2e 100644 (file)
@@ -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