From bc58512a28e111131eb5880fcbb7bc00e73cd900 Mon Sep 17 00:00:00 2001 From: Gunther Nikl Date: Mon, 17 Nov 2014 19:42:40 +0000 Subject: [PATCH] The upper bits of some instruction data should be zero. * gas/config/tc-m68k.c (m68k_ip): Sanitize opcode data. --- gas/config/tc-m68k.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 3b4c3da..c35a024 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -2001,7 +2001,7 @@ m68k_ip (instring) case 'b': if (!isbyte (nextword)) opP->error = _("operand out of range"); - addword (nextword); + addword (nextword & 0xff); /* G.Nikl: clear upper byte */ baseo = 0; break; case 'w': @@ -2546,7 +2546,7 @@ m68k_ip (instring) user beware! */ if (!isbyte (tmpreg)) opP->error = _("out of range"); - insop (tmpreg, opcode); + insop (tmpreg & 0xff, opcode); /* G.Nikl: clear upper byte */ if (isvar (&opP->disp)) the_ins.reloc[the_ins.nrel - 1].n = (opcode->m_codenum) * 2 + 1;