i386: Add MAX_OPERAND_BUFFER_SIZE
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 16 Aug 2022 15:25:49 +0000 (08:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 16 Aug 2022 16:36:58 +0000 (09:36 -0700)
commit9096fc28c62741bfb7962eb5dfdee28a7b1d1345
treeaa6f31a3ebb12f483a7ba6398d3420dfd48eaa4e
parentcb3dee0e0e584ea91b5c0c158fb2482efa6c41be
i386: Add MAX_OPERAND_BUFFER_SIZE

When displaying operands, invalid opcodes may overflow operand buffer
due to additional styling characters.  Each style is encoded with 3
bytes.  Define MAX_OPERAND_BUFFER_SIZE for operand buffer size and
increase it from 100 bytes to 128 bytes to accommodate 9 sets of styles
in an operand.

gas/

PR binutils/29483
* testsuite/gas/i386/i386.exp: Run pr29483.
* testsuite/gas/i386/pr29483.d: New file.
* testsuite/gas/i386/pr29483.s: Likewise.

opcodes/

PR binutils/29483
* i386-dis.c (MAX_OPERAND_BUFFER_SIZE): New.
(obuf): Replace 100 with MAX_OPERAND_BUFFER_SIZE.
(staging_area): Likewise.
(op_out): Likewise.
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/pr29483.d [new file with mode: 0644]
gas/testsuite/gas/i386/pr29483.s [new file with mode: 0644]
opcodes/i386-dis.c