Bug 13348 - Array subscript is above array bounds in libopcodes
Summary: Array subscript is above array bounds in libopcodes
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 11978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-26 09:18 UTC by Dmitry Gorbachev
Modified: 2011-11-03 10:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2011-10-26 09:18:11 UTC
The error happens when compiling with GCC 4.7.0 at -O3 level.

In i386-dis.c, line 11334,

    all_prefixes[i] && i < (int) ARRAY_SIZE (all_prefixes)

the operands of `&&' should be exchanged.
Comment 1 Sourceware Commits 2011-10-26 14:46:04 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2011-10-26 14:46:00

Modified files:
	opcodes        : ChangeLog i386-dis.c 

Log message:
	PR binutils/13348
	* i386-dis.c (print_insn): Fix testing of array subscript.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&r1=1.1769&r2=1.1770
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-dis.c.diff?cvsroot=src&r1=1.265&r2=1.266
Comment 2 Nick Clifton 2011-10-26 14:46:45 UTC
Obvious patch applied.
Comment 3 Pedro Alves 2011-11-03 10:23:57 UTC
*** Bug 11978 has been marked as a duplicate of this bug. ***