History

pass constness from structs to members

Sam Watkins committed 17 years ago

Commit e7297581 parent dca2b151 file · +3 −0Browse files

Unified · Split

tccgen.c+3−0
@@ -3266,9 +3266,11 @@ static void unary(void) · 3265 unmodified lines
32663266 inc(1, tok);
32673267 next();
32683268 } else if (tok == '.' || tok == TOK_ARROW) {
3269+ int qualifiers;
32693270 /* field */
32703271 if (tok == TOK_ARROW)
32713272 indir();
3273+ qualifiers = vtop->type.t & (VT_CONSTANT | VT_VOLATILE);
32723274 test_lvalue();
32733275 gaddrof();
32743276 next();
@@ -3290,6 +3292,7 @@ static void unary(void) · 15 unmodified lines
32903292 gen_op('+');
32913293 /* change type to field type, and set to lvalue */
32923294 vtop->type = s->type;
3295+ vtop->type.t |= qualifiers;
32933296 /* an array is never an lvalue */
32943297 if (!(vtop->type.t & VT_ARRAY)) {
32953298 vtop->r |= lvalue_type(vtop->type.t);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t