gas/arc: Add guard against operand array overflow.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 3 May 2016 12:43:44 +0000 (13:43 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 18 May 2016 21:22:49 +0000 (22:22 +0100)
commit3b889a787863d22694bb53eb08160c94ab52c58d
tree3daf3579bfc29fe642bf90aa804a06dd452c416d
parent45f4ed92d14ddf891be1470556f53de6c94c8dc2
gas/arc: Add guard against operand array overflow.

Currently supplying an input file with too many operands to an
instruction will cause the assembler to overflow and array and trigger
undefined behaviour.

This change checks that we don't access outside the limits of the
operand array.

gas/ChangeLog:

* config/tc-arc.c (tokenize_arguments): Add checks for array
overflow.
* testsuite/gas/arc/asm-errors.s: Addition test line added.
* testsuite/gas/arc/asm-errors.err: Update expected results.
gas/ChangeLog
gas/config/tc-arc.c
gas/testsuite/gas/arc/asm-errors.err
gas/testsuite/gas/arc/asm-errors.s