@@ -2170,7 +2170,6 @@ static struct symbol *evaluate_member_dereference(struct expression *expr)
}
expr->r_bitpos += bytes_to_bits(offset);
expr->type = EXPR_SLICE;
- expr->r_nrbits = member->bit_size;
expr->r_bitpos += member->bit_offset;
expr->ctype = member;
return member;
@@ -206,7 +206,7 @@ struct expression {
// EXPR_SLICE
struct /* slice */ {
struct expression *base;
- unsigned r_bitpos, r_nrbits;
+ unsigned r_bitpos;
};
// EXPR_CAST, EXPR_FORCE_CAST, EXPR_IMPLIED_CAST,
// EXPR_SIZEOF, EXPR_ALIGNOF and EXPR_PTRSIZEOF
@@ -819,7 +819,7 @@ static int show_slice(struct expression *expr)
{
int target = show_expression(expr->base);
int new = new_pseudo();
- printf("\tslice.%d\t\tv%d,v%d,%d\n", expr->r_nrbits, target, new, expr->r_bitpos);
+ printf("\tslice.%d\t\tv%d,v%d,%d\n", expr->ctype->bit_size, target, new, expr->r_bitpos);
return new;
}
EXPR_SLICE::r_nrbits is necessarily equal to its type's bit size. So remove this redundancy. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- evaluate.c | 1 - expression.h | 2 +- show-parse.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-)