]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ada-lang.c
infinite recursion with ada_check_typedef
authorJoel Brobecker <brobecker@gnat.com>
Tue, 23 Nov 2010 01:03:54 +0000 (01:03 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 23 Nov 2010 01:03:54 +0000 (01:03 +0000)
commit3a867c2212df1b93fbac759ba26093512949ff19
treefe801cb54e01a788df2c17fac83f54b745560e57
parentdf30368de152f204fb04f69281ab9e1e2c93cc56
infinite recursion with ada_check_typedef

When trying to resolve an incomplete type, if there is no complete
version of that type available, GDB can go in an infinite loop.

This is because ada_check_typedef makes a recursive call to itself,
in an attempt to make sure that the returned type is never a typedef.
However, when no complete type is found, the current logic causes us
to keep going indefinitely through the same path...

This patch fixes the problem by performing the recursive call to
ada_check_typedef only when a TYPE_CODE_TYPDEF layer needs to be
stripped.

gdb/ChangeLog:

        * ada-lang.c (ada_check_typedef): Call ada_check_typedef only
        if type1 is a typedef.
gdb/ChangeLog
gdb/ada-lang.c