Fix segfault when printing short_integer'last.

* ada-lang.c (ada_find_any_type): Search in the primitive types
        if a symbol could not be found.
This commit is contained in:
Joel Brobecker 2009-03-12 23:17:33 +00:00
parent 680f3fadee
commit 3c513ee699
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2009-03-12 Joel Brobecker <brobecker@adacore.com>
Fix segfault when printing short_integer'last.
* ada-lang.c (ada_find_any_type): Search in the primitive types
if a symbol could not be found.
2009-03-12 Joel Brobecker <brobecker@adacore.com>
* ada-tasks.c (task_states,long_task_states): Add new states

View file

@ -6535,11 +6535,16 @@ struct type *
ada_find_any_type (const char *name)
{
struct symbol *sym = ada_find_any_symbol (name);
struct type *type = NULL;
if (sym != NULL)
return SYMBOL_TYPE (sym);
type = SYMBOL_TYPE (sym);
return NULL;
if (type == NULL)
type = language_lookup_primitive_type_by_name
(language_def (language_ada), current_gdbarch, name);
return type;
}
/* Given NAME and an associated BLOCK, search all symbols for