]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Remove dead code from dwarf2_const_value_data
authorTom Tromey <tromey@adacore.com>
Thu, 20 Mar 2025 14:13:57 +0000 (08:13 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 24 Apr 2025 19:25:08 +0000 (13:25 -0600)
commit2b6e074017c8a08c750af3b6ab1e10eeb70153a2
tree5f13cba6dcc6a070f0713bec9fa41e2d628344ee
parentcdcd13791f7de81f80ab12f5426fe002430f38b6
Remove dead code from dwarf2_const_value_data

dwarf2_const_value_data checks the size of the data like so:

   if (bits < sizeof (*value) * 8)
...
  else if (bits == sizeof (*value) * 8)
...
   else
...

However, 'bits' can only be 8, 16, 32, or 64.  And, because 'value' is
a LONGEST, which is alwasy 64-bit, the final 'else' can never be
taken.

This patch removes the dead code.  And, because this was the only
reason for a non-void return value, the return type is changed as
well.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680
gdb/dwarf2/read.c