aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-bpf.c2
-rw-r--r--gas/testsuite/gas/bpf/bpf.exp3
3 files changed, 13 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3ae1d77..88e6108 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-19 Will Hawkins <hawkinsw@obs.cr>
+
+ * config/tc-bpf.c (parse_expression): Change switch to if so that
+ error condition is handled.
+ * testsuite/gas/bpf/indcall-badoperand.d: New test.
+ * testsuite/gas/bpf/indcall-badoperand.l: Likewise.
+ * testsuite/gas/bpf/indcall-badoperand.s: Likewise.
+ * testsuite/gas/bpf/bpf.exp: Invoke new test.
+
2024-02-19 Jose E. Marchesi <jose.marchesi@oracle.com>
* config/tc-bpf.c (md_assemble): Fix to take into account that
diff --git a/gas/config/tc-bpf.c b/gas/config/tc-bpf.c
index e23de4e..dfa44ea 100644
--- a/gas/config/tc-bpf.c
+++ b/gas/config/tc-bpf.c
@@ -1240,7 +1240,7 @@ parse_expression (char *s, expressionS *exp)
s = input_line_pointer;
input_line_pointer = saved_input_line_pointer;
- switch (exp->X_op == O_absent || exp_parse_failed)
+ if (exp->X_op == O_absent || exp_parse_failed)
return NULL;
/* The expression parser may consume trailing whitespaces. We have
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