aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 2cdbcbe..4c5927d 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1787,9 +1787,10 @@ search_struct_field (char *name, struct value *arg1, int offset,
struct type *type, int looking_for_baseclass)
{
int i;
- int nbases = TYPE_N_BASECLASSES (type);
+ int nbases;
CHECK_TYPEDEF (type);
+ nbases = TYPE_N_BASECLASSES (type);
if (!looking_for_baseclass)
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
@@ -2763,6 +2764,9 @@ check_field (struct type *type, const char *name)
{
int i;
+ /* The type may be a stub. */
+ CHECK_TYPEDEF (type);
+
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);