This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix as segfaults on invalid SSE5 insns


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]