diff options
author | Will Hawkins <hawkinsw@obs.cr> | 2024-02-19 19:24:19 +0100 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2024-02-19 20:48:17 +0100 |
commit | ecd16ae4e47118f66447641d93a6aa1334e550d4 (patch) | |
tree | f380299e54fdd5305a88aae44fa0efd35b3c62ba /gas/testsuite | |
parent | b86b514aace19799ea141514e16296fb63a089b3 (diff) | |
download | gdb-ecd16ae4e47118f66447641d93a6aa1334e550d4.zip gdb-ecd16ae4e47118f66447641d93a6aa1334e550d4.tar.gz gdb-ecd16ae4e47118f66447641d93a6aa1334e550d4.tar.bz2 |
bpf: fix bpf expression parsing regression in GAS
As a result of a switch instead of an if, as would issue non-specific
error messages when it encountered an operand it could not parse in bpf.
This patch fixes that regression and adds a test to prevent it from
reoccurring.
Tested for bpf-unknown-none on x86_64-redhat-linux.
gas/ChangeLog:
* config/tc-bpf.c (parse_expression): Change switch to if so that error
* condition is handled.
* testsuite/gas/bpf/bpf.exp: Invoke new test.
* testsuite/gas/bpf/indcall-badoperand.d: New test.
* testsuite/gas/bpf/indcall-badoperand.l: New test.
* testsuite/gas/bpf/indcall-badoperand.s: New test.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/bpf/bpf.exp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/testsuite/gas/bpf/bpf.exp b/gas/testsuite/gas/bpf/bpf.exp index dae8bd9..5faae5b 100644 --- a/gas/testsuite/gas/bpf/bpf.exp +++ b/gas/testsuite/gas/bpf/bpf.exp @@ -77,6 +77,9 @@ if {[istarget bpf*-*-*]} { run_dump_test disp32-overflow run_dump_test imm32-overflow + # Bad operand (regression) + run_dump_test indcall-badoperand + # In Pseudo-C it is not possible to refer to symbols # as operands that have the same name than registers. run_dump_test regs-for-symbols-pseudoc |