From: Simon Marchi Date: Tue, 25 Nov 2025 04:04:31 +0000 (-0500) Subject: gdb/dwarf: remove nullptr check in dwarf2_locexpr_baton_eval X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=460933ca9f6c797b9196b11b6e350263a2c7e4cf;p=thirdparty%2Fbinutils-gdb.git gdb/dwarf: remove nullptr check in dwarf2_locexpr_baton_eval The sole caller of this function passes the address of a field, we know it's not nullptr. Change-Id: Ie8c609136e225667b724ebc27a395f6e615f1dea Approved-By: Tom Tromey --- diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 9ab0c70b8f7..ecda7a6cb7d 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -1586,7 +1586,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, gdb::array_view push_values, bool *is_reference) { - if (dlbaton == NULL || dlbaton->size == 0) + if (dlbaton->size == 0) return 0; dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;