mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-15 20:05:46 +08:00
2007-08-02 Michael Snyder <msnyder@access-company.com>
* gdbtypes.c (create_set_type): Test should only be done within the preceeding if block. Otherwise, variable is uninitialized.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2007-08-02 Michael Snyder <msnyder@access-company.com>
|
2007-08-02 Michael Snyder <msnyder@access-company.com>
|
||||||
|
|
||||||
|
* gdbtypes.c (create_set_type): Test should only be done within
|
||||||
|
the preceeding if block. Otherwise, variable is uninitialized.
|
||||||
|
|
||||||
* gdbtypes.c (check_typedef): Guard NULL.
|
* gdbtypes.c (check_typedef): Guard NULL.
|
||||||
|
|
||||||
2007-08-01 Michael Snyder <msnyder@access-company.com>
|
2007-08-01 Michael Snyder <msnyder@access-company.com>
|
||||||
|
@ -843,7 +843,6 @@ create_string_type (struct type *result_type, struct type *range_type)
|
|||||||
struct type *
|
struct type *
|
||||||
create_set_type (struct type *result_type, struct type *domain_type)
|
create_set_type (struct type *result_type, struct type *domain_type)
|
||||||
{
|
{
|
||||||
LONGEST low_bound, high_bound, bit_length;
|
|
||||||
if (result_type == NULL)
|
if (result_type == NULL)
|
||||||
{
|
{
|
||||||
result_type = alloc_type (TYPE_OBJFILE (domain_type));
|
result_type = alloc_type (TYPE_OBJFILE (domain_type));
|
||||||
@ -856,17 +855,17 @@ create_set_type (struct type *result_type, struct type *domain_type)
|
|||||||
|
|
||||||
if (!TYPE_STUB (domain_type))
|
if (!TYPE_STUB (domain_type))
|
||||||
{
|
{
|
||||||
|
LONGEST low_bound, high_bound, bit_length;
|
||||||
if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0)
|
if (get_discrete_bounds (domain_type, &low_bound, &high_bound) < 0)
|
||||||
low_bound = high_bound = 0;
|
low_bound = high_bound = 0;
|
||||||
bit_length = high_bound - low_bound + 1;
|
bit_length = high_bound - low_bound + 1;
|
||||||
TYPE_LENGTH (result_type)
|
TYPE_LENGTH (result_type)
|
||||||
= (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
|
= (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
|
||||||
|
if (low_bound >= 0)
|
||||||
|
TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
|
||||||
}
|
}
|
||||||
TYPE_FIELD_TYPE (result_type, 0) = domain_type;
|
TYPE_FIELD_TYPE (result_type, 0) = domain_type;
|
||||||
|
|
||||||
if (low_bound >= 0)
|
|
||||||
TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
|
|
||||||
|
|
||||||
return (result_type);
|
return (result_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user