aboutsummaryrefslogtreecommitdiff
path: root/binutils/ieee.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-10-28 22:12:02 +0000
committerIan Lance Taylor <ian@airs.com>1996-10-28 22:12:02 +0000
commit5317d6f945f2d58c50b3dbed18c01ce7c25f43d1 (patch)
treea5f618fa20cb6839670fba26d2ce03f04bc1824f /binutils/ieee.c
parent9720a1a70fe9273d1c71a96722e6ae70e6a9b2a2 (diff)
downloadgdb-5317d6f945f2d58c50b3dbed18c01ce7c25f43d1.zip
gdb-5317d6f945f2d58c50b3dbed18c01ce7c25f43d1.tar.gz
gdb-5317d6f945f2d58c50b3dbed18c01ce7c25f43d1.tar.bz2
* ieee.c (ieee_array_type): Remember the correct size.
Diffstat (limited to 'binutils/ieee.c')
-rw-r--r--binutils/ieee.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/binutils/ieee.c b/binutils/ieee.c
index f1276b3..2756ba1 100644
--- a/binutils/ieee.c
+++ b/binutils/ieee.c
@@ -5723,14 +5723,21 @@ ieee_array_type (p, low, high, stringp)
struct ieee_handle *info = (struct ieee_handle *) p;
unsigned int eleindx;
boolean localp;
+ unsigned int size;
struct ieee_modified_type *m = NULL;
struct ieee_modified_array_type *a;
/* IEEE does not store the range, so we just ignore it. */
ieee_pop_unused_type (info);
localp = info->type_stack->type.localp;
+ size = info->type_stack->type.size;
eleindx = ieee_pop_type (info);
+ /* If we don't know the range, treat the size as exactly one
+ element. */
+ if (low < high)
+ size *= (high - low) + 1;
+
if (! localp)
{
m = ieee_get_modified_info (info, eleindx);
@@ -5740,11 +5747,11 @@ ieee_array_type (p, low, high, stringp)
for (a = m->arrays; a != NULL; a = a->next)
{
if (a->low == low && a->high == high)
- return ieee_push_type (info, a->indx, 0, false, false);
+ return ieee_push_type (info, a->indx, size, false, false);
}
}
- if (! ieee_define_type (info, 0, false, localp)
+ if (! ieee_define_type (info, size, false, localp)
|| ! ieee_write_number (info, low == 0 ? 'Z' : 'C')
|| ! ieee_write_number (info, eleindx))
return false;