mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-14 19:38:01 +08:00
* valops.c (value_cast, value_slice), parse.c (follow_types): Add
FIXME-type-allocation comments.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
Tue Mar 14 05:52:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
|
Tue Mar 14 05:52:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||||
|
|
||||||
|
* valops.c (value_cast, value_slice), parse.c (follow_types): Add
|
||||||
|
FIXME-type-allocation comments.
|
||||||
|
|
||||||
* gdbtypes.h (struct type): Fix comment about what units the
|
* gdbtypes.h (struct type): Fix comment about what units the
|
||||||
TYPE_LENGTH is in.
|
TYPE_LENGTH is in.
|
||||||
|
|
||||||
|
@ -875,6 +875,8 @@ follow_types (follow_type)
|
|||||||
break;
|
break;
|
||||||
case tp_array:
|
case tp_array:
|
||||||
array_size = pop_type_int ();
|
array_size = pop_type_int ();
|
||||||
|
/* FIXME-type-allocation: need a way to free this type when we are
|
||||||
|
done with it. */
|
||||||
range_type =
|
range_type =
|
||||||
create_range_type ((struct type *) NULL,
|
create_range_type ((struct type *) NULL,
|
||||||
builtin_type_int, 0,
|
builtin_type_int, 0,
|
||||||
@ -887,6 +889,8 @@ follow_types (follow_type)
|
|||||||
= BOUND_CANNOT_BE_DETERMINED;
|
= BOUND_CANNOT_BE_DETERMINED;
|
||||||
break;
|
break;
|
||||||
case tp_function:
|
case tp_function:
|
||||||
|
/* FIXME-type-allocation: need a way to free this type when we are
|
||||||
|
done with it. */
|
||||||
follow_type = lookup_function_type (follow_type);
|
follow_type = lookup_function_type (follow_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,8 @@ value_cast (type, arg2)
|
|||||||
int new_length = val_length / TYPE_LENGTH (element_type);
|
int new_length = val_length / TYPE_LENGTH (element_type);
|
||||||
if (val_length % TYPE_LENGTH (element_type) != 0)
|
if (val_length % TYPE_LENGTH (element_type) != 0)
|
||||||
warning("array element type size does not divide object size in cast");
|
warning("array element type size does not divide object size in cast");
|
||||||
|
/* FIXME-type-allocation: need a way to free this type when we are
|
||||||
|
done with it. */
|
||||||
range_type = create_range_type ((struct type *) NULL,
|
range_type = create_range_type ((struct type *) NULL,
|
||||||
TYPE_TARGET_TYPE (range_type),
|
TYPE_TARGET_TYPE (range_type),
|
||||||
low_bound, new_length + low_bound - 1);
|
low_bound, new_length + low_bound - 1);
|
||||||
@ -2054,6 +2056,7 @@ value_slice (array, lowbound, length)
|
|||||||
value_ptr array;
|
value_ptr array;
|
||||||
int lowbound, length;
|
int lowbound, length;
|
||||||
{
|
{
|
||||||
|
COERCE_VARYING_ARRAY (array);
|
||||||
if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_BITSTRING)
|
if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_BITSTRING)
|
||||||
error ("not implemented - bitstring slice");
|
error ("not implemented - bitstring slice");
|
||||||
if (TYPE_CODE (VALUE_TYPE (array)) != TYPE_CODE_ARRAY
|
if (TYPE_CODE (VALUE_TYPE (array)) != TYPE_CODE_ARRAY
|
||||||
@ -2071,6 +2074,8 @@ value_slice (array, lowbound, length)
|
|||||||
if (lowbound < lowerbound || length < 0
|
if (lowbound < lowerbound || length < 0
|
||||||
|| lowbound + length - 1 > upperbound)
|
|| lowbound + length - 1 > upperbound)
|
||||||
error ("slice out of range");
|
error ("slice out of range");
|
||||||
|
/* FIXME-type-allocation: need a way to free this type when we are
|
||||||
|
done with it. */
|
||||||
slice_range_type = create_range_type ((struct type*) NULL,
|
slice_range_type = create_range_type ((struct type*) NULL,
|
||||||
TYPE_TARGET_TYPE (range_type),
|
TYPE_TARGET_TYPE (range_type),
|
||||||
lowerbound,
|
lowerbound,
|
||||||
|
Reference in New Issue
Block a user