ubsan: vax: pointer overflow

Message ID YM1HyGgARNhUw8/X@squeak.grove.modra.org
State New
Headers show
Series
  • ubsan: vax: pointer overflow
Related show

Commit Message

Fangrui Song via Binutils June 19, 2021, 1:26 a.m.
"VAX export class call relocation test" fails with ubsan on a 32-bit
host.

	* vax-dis.c (print_insn_vax): Avoid pointer overflow.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c
index e218d4969ca..ed4610b7afa 100644
--- a/opcodes/vax-dis.c
+++ b/opcodes/vax-dis.c
@@ -490,7 +490,7 @@  print_insn_vax (bfd_vma memaddr, disassemble_info *info)
 
   while (*argp)
     {
-      arg += print_insn_arg (argp, arg, memaddr + arg - buffer, info);
+      arg += print_insn_arg (argp, arg, memaddr + (arg - buffer), info);
       argp += 2;
       if (*argp)
 	(*info->fprintf_func) (info->stream, ",");