mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
Add dynamic_prop::is_constant
I noticed many spots checking whether a dynamic property's kind is PROP_CONST. Some spots, I think, are doing a slightly incorrect check -- checking for != PROP_UNDEFINED where == PROP_CONST is actually required, the key thing being that const_val may only be called for PROP_CONST properties. This patch adds dynamic::is_constant and then updates these checks to use it. Regression tested on x86-64 Fedora 36.
This commit is contained in:
@@ -176,11 +176,11 @@ f_language::f_type_print_varspec_suffix (struct type *type,
|
||||
else if (type_not_allocated (type))
|
||||
print_rank_only = true;
|
||||
else if ((TYPE_ASSOCIATED_PROP (type)
|
||||
&& PROP_CONST != TYPE_ASSOCIATED_PROP (type)->kind ())
|
||||
&& !TYPE_ASSOCIATED_PROP (type)->is_constant ())
|
||||
|| (TYPE_ALLOCATED_PROP (type)
|
||||
&& PROP_CONST != TYPE_ALLOCATED_PROP (type)->kind ())
|
||||
&& !TYPE_ALLOCATED_PROP (type)->is_constant ())
|
||||
|| (TYPE_DATA_LOCATION (type)
|
||||
&& PROP_CONST != TYPE_DATA_LOCATION (type)->kind ()))
|
||||
&& !TYPE_DATA_LOCATION (type)->is_constant ()))
|
||||
{
|
||||
/* This case exist when we ptype a typename which has the dynamic
|
||||
properties but cannot be resolved as there is no object. */
|
||||
@@ -395,7 +395,7 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
|
||||
asked to print the type of a value with a dynamic type then the
|
||||
bounds will not have been resolved. */
|
||||
|
||||
if (type->bounds ()->high.kind () == PROP_CONST)
|
||||
if (type->bounds ()->high.is_constant ())
|
||||
{
|
||||
LONGEST upper_bound = f77_get_upperbound (type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user