summaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 0495a11bfd7..2e08e9355f5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -3145,7 +3145,9 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
{
val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);
type = value_type (val);
- if (TYPE_HIGH_BOUND_UNDEFINED (TYPE_INDEX_TYPE (type)))
+ if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && is_dynamic_type (TYPE_INDEX_TYPE (type))
+ && TYPE_HIGH_BOUND_UNDEFINED (TYPE_INDEX_TYPE (type)))
return allocate_optimized_out_value (size_type);
}
else