ubsan: vax: pointer overflow

Alan Modra amodra@gmail.com
Sat Jun 19 01:26:32 GMT 2021


"VAX export class call relocation test" fails with ubsan on a 32-bit
host.

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

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, ",");

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list