summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 0cbabc2..547d471 100644
--- a/parse.c
+++ b/parse.c
@@ -2380,7 +2380,9 @@ static Node *new_add(Node *lhs, Node *rhs, Token *tok) {
}
// ptr + num
- rhs = new_binary(ND_MUL, rhs, new_long(lhs->ty->base->size, tok), tok);
+ Node *base_size = new_long(lhs->ty->base->size, tok);
+ base_size->is_sizeof = lhs->ty->base;
+ rhs = new_binary(ND_MUL, rhs, base_size, tok);
return new_binary(ND_ADD, lhs, rhs, tok);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback