diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-11-19 22:37:35 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-11-19 22:37:35 +0000 |
commit | 5b3d5b7dfc22092208dd9434e1035198d19efc47 (patch) | |
tree | 41d91b93d382277d2648f20d32cb9358989f20c5 | |
parent | a10967fa49093a68f1e3af186eebbd10dc048339 (diff) | |
download | gdb-5b3d5b7dfc22092208dd9434e1035198d19efc47.zip gdb-5b3d5b7dfc22092208dd9434e1035198d19efc47.tar.gz gdb-5b3d5b7dfc22092208dd9434e1035198d19efc47.tar.bz2 |
Wrong function used to perform address addition/subtraction.
* ada-lang.c (ada_type_match): Stop making TYPE_CODE_VOID
a wildcard matching any type. For types that we don't already
handle specifically, make sure that both types have the same code.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/ada-lang.c | 11 |
2 files changed, 10 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a5b4260..1a74a3b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2009-11-19 Joel Brobecker <brobecker@adacore.com> + Wrong function used to perform address addition/subtraction. + * ada-lang.c (ada_type_match): Stop making TYPE_CODE_VOID + a wildcard matching any type. For types that we don't already + handle specifically, make sure that both types have the same code. + +2009-11-19 Joel Brobecker <brobecker@adacore.com> + * ada-lang.c (ada_decode): Add handling of "TB" suffixes for task bodies. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 06aaadc..74336d8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2977,10 +2977,9 @@ resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, /* Return non-zero if formal type FTYPE matches actual type ATYPE. If MAY_DEREF is non-zero, the formal may be a pointer and the actual - a non-pointer. A type of 'void' (which is never a valid expression type) - by convention matches anything. */ + a non-pointer. */ /* The term "match" here is rather loose. The match is heuristic and - liberal. FIXME: TOO liberal, in fact. */ + liberal. */ static int ada_type_match (struct type *ftype, struct type *atype, int may_deref) @@ -2993,14 +2992,10 @@ ada_type_match (struct type *ftype, struct type *atype, int may_deref) if (TYPE_CODE (atype) == TYPE_CODE_REF) atype = TYPE_TARGET_TYPE (atype); - if (TYPE_CODE (ftype) == TYPE_CODE_VOID - || TYPE_CODE (atype) == TYPE_CODE_VOID) - return 1; - switch (TYPE_CODE (ftype)) { default: - return 1; + return TYPE_CODE (ftype) == TYPE_CODE (atype); case TYPE_CODE_PTR: if (TYPE_CODE (atype) == TYPE_CODE_PTR) return ada_type_match (TYPE_TARGET_TYPE (ftype), |