]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
Avoid assertion failure due to complex type change
authorTom Tromey <tromey@adacore.com>
Thu, 2 Apr 2020 19:13:02 +0000 (13:13 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 2 Apr 2020 19:17:27 +0000 (13:17 -0600)
commit0830d301901d225403eaf6629c20a6c09f3ec8f6
tree9f5ba89cdcfdc1e61a37c676a555bcba373cab2f
parente7da7f8f71572e3ef71a22ad3fae2388a53bd84c
Avoid assertion failure due to complex type change

Tankut Baris Aktemur pointed out that the recent series to change how
complex types are handled introduced a regression.

This assert in init_complex_type was firing:

  gdb_assert (TYPE_CODE (target_type) == TYPE_CODE_INT
      || TYPE_CODE (target_type) == TYPE_CODE_FLT);

The problem was that f-lang.c could call init_complex_type with a type
whose code was TYPE_CODE_ERROR.

It seemed best to me to fix this in f-lang.c, rather than to change
init_complex_type to accept error types.

Tested on x86-64 Fedora 30.  I'm checking this in.

gdb/ChangeLog
2020-04-02  Tom Tromey  <tromey@adacore.com>

* f-lang.c (build_fortran_types): Use arch_type to initialize
builtin_complex_s32 in the TYPE_CODE_ERROR case.
gdb/ChangeLog
gdb/f-lang.c