x86: disassembling over-long insns
authorJan Beulich <jbeulich@suse.com>
Fri, 26 May 2023 07:53:25 +0000 (09:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 26 May 2023 07:53:25 +0000 (09:53 +0200)
commitd8acf3769314463ba7ed8262bf105a64f1f2e838
treea94a40c22dd14942eeda60aef4c7285a06c6decd
parenta4aa034a0abca9c93910c23fbe7ed5f07b4c4b0b
x86: disassembling over-long insns

The present way of dealing with them - misusing MAX_MNEM_SIZE, which has
nothing to do with insn length - leads to inconsistent results. Since we
allow for up to MAX_CODE_LENGTH - 1 prefix bytes (which then could be
followed by another MAX_CODE_LENGTH "normal" insn bytes until we're done
decoding), size the_buffer[] accordingly.

Move struct dis_private down to be able to use MAX_CODE_LENGTH without
moving its #define. While doing this also alter the order to have the
potentially large array last.
opcodes/i386-dis.c