diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2024-09-09 23:12:55 -0400 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2024-09-09 23:12:55 -0400 |
commit | 0c37353e44f0feaba9d3139f8b2afb33e75c7469 (patch) | |
tree | 3576cdeea71e3d1804dfc4ac0b215039fded492b /parse.c | |
parent | 5c3a9ab4f7dfcbcf109944277ed6ad04246c3e9e (diff) |
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |