diff options
author | Jan Beulich <jbeulich@suse.com> | 2025-01-06 16:01:47 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2025-01-06 16:01:47 +0100 |
commit | 9d02cb7fe0d636be390e43e06f39b30b834e89e4 (patch) | |
tree | 94917d91fc7cb3af2c5018b36b07056c3e57518c | |
parent | 30200464e9dd7903be8f186ea137b7982f812670 (diff) | |
download | gdb-9d02cb7fe0d636be390e43e06f39b30b834e89e4.zip gdb-9d02cb7fe0d636be390e43e06f39b30b834e89e4.tar.gz gdb-9d02cb7fe0d636be390e43e06f39b30b834e89e4.tar.bz2 |
x86/Intel: don't accept memory operands with J*CXZ and LOOP*
PR gas/31887
Like for, in particular, J<cc> such should be rejected. Simplify the
respective conditional in i386_intel_operand(), leveraging that
JumpAbsolute will never occur in the first template of a mnemonic-
specific group (thus making it unnecessary to exclude that one case).
At this occasion do the same simplification later in the function as
well: The resulting two operands will uniformly be invalid for all
mnemonics other than CALL and JMP (and their AT&T counterparts, which
we've been wrongly accepting in Intel syntax) anyway.
-rw-r--r-- | gas/config/tc-i386-intel.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index 5b7de9c..892513c 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -907,9 +907,7 @@ i386_intel_operand (char *operand_string, int got_a_float) } /* Operands for jump/call need special consideration. */ - if (current_templates.start->opcode_modifier.jump == JUMP - || current_templates.start->opcode_modifier.jump == JUMP_DWORD - || current_templates.start->opcode_modifier.jump == JUMP_INTERSEGMENT + if (current_templates.start->opcode_modifier.jump || current_templates.start->mnem_off == MN_jmpabs) { bool jumpabsolute = false; @@ -1046,9 +1044,7 @@ i386_intel_operand (char *operand_string, int got_a_float) ljmp 0x9090,0x90909090 */ - if ((current_templates.start->opcode_modifier.jump == JUMP_INTERSEGMENT - || current_templates.start->opcode_modifier.jump == JUMP_DWORD - || current_templates.start->opcode_modifier.jump == JUMP) + if (current_templates.start->opcode_modifier.jump && this_operand == 1 && intel_state.seg == NULL && i.mem_operands == 1 |