Re: [PATCH 6/8] Return -1 on memory error in print_insn_m68k

Alan Modra
2017-01-12T14:38:22Z

On Thu, Jan 12, 2017 at 11:50:21AM +0000, Yao Qi wrote:
> On 17-01-12 08:45:14, Alan Modra wrote:
> > On Tue, Jan 10, 2017 at 12:26:16PM +0000, Yao Qi wrote:
> > > * m68k-dis.c (match_insn_m68k): Extend comments. Return -1
> > > if FETCH_DATA returns 0.
> > > (m68k_scan_mask): Likewise.
> > > (print_insn_m68k): Update code to handle -1 return value.
> >
> > This misses one FETCH_DATA call, in m68k_scan_mask.
> >
>
> I can't remember the reason I didn't change it. Sorry.

Actually there is a good reason not to change that call, I just didn't
look at the code well enough and thought you'd accidentally missed
it. The previous patch is OK. The newest one would fail if you had
a 2-byte insn at the end of a segment and happened to try a 4-byte
insn match first.

--
Alan Modra
Australia Development Lab, IBM