From 1300f5dda8b5e782749f40dda5ee613eb65273f8 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 10 Nov 2000 23:18:16 +0000 Subject: * stabsread.c (read_range_type): Properly construct complex type nodes. --- gdb/stabsread.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gdb/stabsread.c') diff --git a/gdb/stabsread.c b/gdb/stabsread.c index fb1a1843db..730df9d80b 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -4593,14 +4593,18 @@ read_range_type (char **pp, int typenums[2], struct objfile *objfile) if (n3 == 0 && n2 > 0) { + struct type *float_type + = init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile); + if (self_subrange) { - return init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile); + struct type *complex_type = + init_type (TYPE_CODE_COMPLEX, 2 * n2, 0, NULL, objfile); + TYPE_TARGET_TYPE (complex_type) = float_type; + return complex_type; } else - { - return init_type (TYPE_CODE_FLT, n2, 0, NULL, objfile); - } + return float_type; } /* If the upper bound is -1, it must really be an unsigned int. */ -- cgit v1.2.1