summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-17 21:04:52 +1030
committerAlan Modra <amodra@gmail.com>2023-03-19 23:35:18 +1030
commit92d450c79ad321e42f9a77692b5db10d0f7b9344 (patch)
tree1824700524a15889e996cbb9cc7f157063f2c6ba /opcodes
parent1a2c0dc1ab7aff2d1bca30a93dc4edb255828d15 (diff)
downloadbinutils-gdb-92d450c79ad321e42f9a77692b5db10d0f7b9344.tar.gz
segfault at i386-dis.c:9815
* i386-dis.c (print_insn): Access "ins" and "priv" via volatile pointers after second sigsetjmp return.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/i386-dis.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index a414e8c9b1e..9684dcda746 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -9808,12 +9808,17 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax)
/* Getting here means we tried for data but didn't get it. That
means we have an incomplete instruction of some sort. Just
print the first byte as a prefix or a .byte pseudo-op. */
- if (ins.codep > priv.the_buffer)
+ volatile struct dis_private *ppriv = &priv;
+ volatile instr_info *pins = &ins;
+ if (pins->codep > ppriv->the_buffer)
{
const char *name = NULL;
- if (ins.prefixes || ins.fwait_prefix >= 0 || (ins.rex & REX_OPCODE))
- name = prefix_name (&ins, priv.the_buffer[0], priv.orig_sizeflag);
+ if (pins->prefixes
+ || pins->fwait_prefix >= 0
+ || (pins->rex & REX_OPCODE))
+ name = prefix_name (&ins, ppriv->the_buffer[0],
+ ppriv->orig_sizeflag);
if (name != NULL)
i386_dis_printf (&ins, dis_style_mnemonic, "%s", name);
else
@@ -9822,7 +9827,7 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax)
i386_dis_printf (&ins, dis_style_assembler_directive,
".byte ");
i386_dis_printf (&ins, dis_style_immediate, "0x%x",
- (unsigned int) priv.the_buffer[0]);
+ (unsigned int) ppriv->the_buffer[0]);
}
return 1;