[binutils-gdb] gdb/dwarf: change base_types_equal_p to return bool
Simon Marchi via Gdb-cvs <[email protected]>
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=514c14c245fdc2d6b9346eed804b450f6999347e commit 514c14c245fdc2d6b9346eed804b450f6999347e Author: Simon Marchi <[email protected]> Date: Wed Mar 11 14:05:41 2026 -0400 gdb/dwarf: change base_types_equal_p to return bool Change-Id: I66f13baf8fe2b15fa2bab9f3dcb60c3ad9e91d6a Approved-By: Tom Tromey <[email protected]> Diff: --- gdb/dwarf2/expr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index c253460ba34..a5ea43e0bcc 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -1353,13 +1353,15 @@ dwarf_expr_require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end, checks that might reasonably be needed to compare DWARF base types. */ -static int +static bool base_types_equal_p (struct type *t1, struct type *t2) { if (t1->code () != t2->code ()) - return 0; + return false; + if (t1->is_unsigned () != t2->is_unsigned ()) - return 0; + return false; + return t1->length () == t2->length (); } @@ -2050,7 +2052,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, first = fetch (0); pop (); - if (! base_types_equal_p (first->type (), second->type ())) + if (!base_types_equal_p (first->type (), second->type ())) error (_("Incompatible types on DWARF stack")); switch (op)