- CORE_ADDR addr
- = unpack_pointer (TYPE_FIELD_TYPE (type, i),
- valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
+ struct type *field_type;
+ LONGEST field_offset;
+ int field_length;
+ CORE_ADDR addr;
+
+ field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+ field_offset = TYPE_FIELD_BITPOS (type, i) / 8;
+ field_length = TYPE_LENGTH (field_type);
+
+ if (!value_bytes_available (val, embedded_offset + field_offset,
+ field_length))
+ throw_error (NOT_AVAILABLE_ERROR,
+ _("Virtual baseclass pointer is not available"));