From: Joel Brobecker Date: Wed, 2 Jan 2008 11:18:03 +0000 (+0000) Subject: * ada-lang.c (ada_value_equal): Dereference reference types when X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f58b38bf6a319bb88f01acfafe5f5e6eb614f79b;p=binutils-gdb.git * ada-lang.c (ada_value_equal): Dereference reference types when comparing arrays. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 823082ed060..e2784e89497 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-01-02 Joel Brobecker + + * ada-lang.c (ada_value_equal): Dereference reference types when + comparing arrays. + 2008-01-01 Daniel Jacobowitz Updated copyright notices for most files. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 58a2f5781b4..b3090a301cc 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -7744,6 +7744,11 @@ ada_value_equal (struct value *arg1, struct value *arg2) if (ada_is_direct_array_type (value_type (arg1)) || ada_is_direct_array_type (value_type (arg2))) { + /* Automatically dereference any array reference before + we attempt to perform the comparison. */ + arg1 = ada_coerce_ref (arg1); + arg2 = ada_coerce_ref (arg2); + arg1 = ada_coerce_to_simple_array (arg1); arg2 = ada_coerce_to_simple_array (arg2); if (TYPE_CODE (value_type (arg1)) != TYPE_CODE_ARRAY