* ch-typeprint.c (chill_type_print_base): Make TYPE_CODE_RANGE

case more robust.
This fixes PR 5016.
This commit is contained in:
Per Bothner 1994-09-05 21:47:03 +00:00
parent e1728bee60
commit 42fca93eb8
2 changed files with 17 additions and 14 deletions

View File

@ -1,3 +1,8 @@
Mon Sep 5 14:46:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
* ch-typeprint.c (chill_type_print_base): Make TYPE_CODE_RANGE
case more robust.
Sun Sep 4 16:06:34 1994 Stan Shebs (shebs@andros.cygnus.com)
* i960-tdep.c (signal.h): Don't include.

View File

@ -243,25 +243,23 @@ chill_type_print_base (type, stream, show, level)
break;
case TYPE_CODE_RANGE:
if (TYPE_DUMMY_RANGE (type))
chill_type_print_base (TYPE_TARGET_TYPE (type),
stream, show, level);
else if (TYPE_TARGET_TYPE (type))
if (TYPE_DUMMY_RANGE (type) > 0)
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
else
{
chill_type_print_base (TYPE_TARGET_TYPE (type),
stream, show, level);
struct type *target = TYPE_TARGET_TYPE (type);
if (target && TYPE_NAME (target))
fputs_filtered (TYPE_NAME (target), stream);
else
fputs_filtered ("RANGE", stream);
if (target == NULL)
target = builtin_type_long;
fputs_filtered (" (", stream);
print_type_scalar (TYPE_TARGET_TYPE (type),
TYPE_FIELD_BITPOS (type, 0), stream);
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
fputs_filtered (":", stream);
print_type_scalar (TYPE_TARGET_TYPE (type),
TYPE_FIELD_BITPOS (type, 1), stream);
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
fputs_filtered (")", stream);
}
else
fprintf_filtered (stream, "RANGE? (%s : %d)",
TYPE_FIELD_BITPOS (type, 0),
TYPE_FIELD_BITPOS (type, 1));
break;
case TYPE_CODE_ENUM: