diff --git a/dwarf_loader.c b/dwarf_loader.c index efcd7a5..fca25c5 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -1927,7 +1927,7 @@ static int class_member__cache_byte_size(struct tag *self, struct cu *cu, if (member->bitfield_size != 0) { struct tag *type = tag__follow_typedef(&member->tag, cu); check_volatile: - if (tag__is_volatile(type)) { + if (tag__is_volatile(type) || tag__is_const(type)) { type = tag__follow_typedef(type, cu); goto check_volatile; } diff --git a/dwarves.h b/dwarves.h index ef87d79..672b236 100644 --- a/dwarves.h +++ b/dwarves.h @@ -359,6 +359,11 @@ static inline int tag__is_union(const struct tag *self) return self->tag == DW_TAG_union_type; } +static inline int tag__is_const(const struct tag *self) +{ + return self->tag == DW_TAG_const_type; +} + static inline bool tag__is_variable(const struct tag *self) { return self->tag == DW_TAG_variable;