Unified · Split
| @@ -3266,9 +3266,11 @@ static void unary(void) · 3265 unmodified lines | ||
| 3266 | 3266 | inc(1, tok); |
| 3267 | 3267 | next(); |
| 3268 | 3268 | } else if (tok == '.' || tok == TOK_ARROW) { |
| 3269 | + int qualifiers; | |
| 3269 | 3270 | /* field */ |
| 3270 | 3271 | if (tok == TOK_ARROW) |
| 3271 | 3272 | indir(); |
| 3273 | + qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE); | |
| 3272 | 3274 | test_lvalue(); |
| 3273 | 3275 | gaddrof(); |
| 3274 | 3276 | next(); |
| @@ -3290,6 +3292,7 @@ static void unary(void) · 15 unmodified lines | ||
| 3290 | 3292 | gen_op('+'); |
| 3291 | 3293 | /* change type to field type, and set to lvalue */ |
| 3292 | 3294 | vtop->type = s->type; |
| 3295 | + vtop->type.t |= qualifiers; | |
| 3293 | 3296 | /* an array is never an lvalue */ |
| 3294 | 3297 | if (!(vtop->type.t & VT_ARRAY)) { |
| 3295 | 3298 | vtop->r |= lvalue_type(vtop->type.t); |