This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix as segfaults on invalid SSE5 insns
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Michael Meissner <michael dot meissner at amd dot com>, binutils at sources dot redhat dot com
- Date: Sat, 29 Dec 2007 11:34:10 -0800
- Subject: Re: [PATCH] Fix as segfaults on invalid SSE5 insns
- References: <20071229192025.GJ2947@sunsite.mff.cuni.cz>
On Sat, Dec 29, 2007 at 08:20:25PM +0100, Jakub Jelinek wrote:
> Hi!
>
> Gas ATM segfaults on invalid operands like:
> permpd %xmm1, %xmm0, src1(%rip), %xmm0
> which current GCC trunk generates on sse5-permpX.c.
> While GCC should be fixed, gas shouldn't segfault.
>
> process_drex initializes modrm_reg{,mem} to None (== 65535). All valid
> operands set those two to something else, but in case of invalid operands
> process_drex calls as_bad, but leaves those fields at 65535. Later on
> these 2 fields are used as indexes into arrays without checking.
>
> I think it is better to just initialize to 0, i.e. something that won't
> crash, we already issued diagnostics and 0 will allow us to get further.
>
> Ok to commit?
>
> 2007-12-29 Jakub Jelinek <jakub@redhat.com>
>
> * config/tc-i386.c (process_drex): Initialize modrm_reg and
> modrm_regmem to 0 instead of None.
>
It is OK if Michael has no objections.
H.J.