aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-08-16 08:25:49 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-08-16 09:36:58 -0700
commit9096fc28c62741bfb7962eb5dfdee28a7b1d1345 (patch)
treeaa6f31a3ebb12f483a7ba6398d3420dfd48eaa4e /gas
parentcb3dee0e0e584ea91b5c0c158fb2482efa6c41be (diff)
downloadbinutils-9096fc28c62741bfb7962eb5dfdee28a7b1d1345.zip
binutils-9096fc28c62741bfb7962eb5dfdee28a7b1d1345.tar.gz
binutils-9096fc28c62741bfb7962eb5dfdee28a7b1d1345.tar.bz2
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
-rw-r--r--gas/testsuite/gas/i386/pr29483.d10
-rw-r--r--gas/testsuite/gas/i386/pr29483.s3
3 files changed, 14 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 1d27dfc..68576be 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -1346,6 +1346,7 @@ if [gas_64_check] then {
run_dump_test ehinterp
}
run_dump_test pr27198
+ run_dump_test pr29483
set ASFLAGS "$old_ASFLAGS --64"
diff --git a/gas/testsuite/gas/i386/pr29483.d b/gas/testsuite/gas/i386/pr29483.d
new file mode 100644
index 0000000..6592ecd
--- /dev/null
+++ b/gas/testsuite/gas/i386/pr29483.d
@@ -0,0 +1,10 @@
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <pr29483>:
+ +[a-f0-9]+: 65 62 62 7d 97 a0 94 ff 20 20 20 ae vpscatterdd %xmm26,%gs:-0x51dfdfe0\(%rdi,%xmm23,8\)\{bad\}\{%k7\}\{z\}/\(bad\)
+#pass
diff --git a/gas/testsuite/gas/i386/pr29483.s b/gas/testsuite/gas/i386/pr29483.s
new file mode 100644
index 0000000..6b133ac
--- /dev/null
+++ b/gas/testsuite/gas/i386/pr29483.s
@@ -0,0 +1,3 @@
+ .text
+pr29483:
+ .byte 0x65,0x62,0x62,0x7d,0x97,0xa0,0x94,0xff,0x20,0x20,0x20,0xae