From 86c405cf6f27615237545997afc9ee2cf815022c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 18 Apr 2004 17:09:32 -0700 Subject: [PATCH] Fix pointer addition We should multiply with the size of the object we point to, not the size of the pointer ;) --- evaluate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluate.c b/evaluate.c index dd28f25f..7f2cbd31 100644 --- a/evaluate.c +++ b/evaluate.c @@ -265,7 +265,7 @@ static struct symbol *evaluate_ptr_add(struct expression *expr, struct expressio examine_symbol_type(ctype); ctype = degenerate(expr, ctype, &ptr); - bit_size = ctype->bit_size; + bit_size = ctype->ctype.base_type->bit_size; /* Special case: adding zero commonly happens as a result of 'array[0]' */ if (i->type == EXPR_VALUE && !i->value) { -- 2.11.4.GIT