mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-10 12:30:03 +00:00
Allow initialization of static/global variables with the address of members of const structs.
Note that this code currently permits discarding the const qualifier via such an initialization. That should give a diagnostic, but currently it doesn't in this or various other cases. The following code (derived from a csmith-generated test case) illustrates the problem: struct S0 { const long f4; }; const struct S0 g_149; const long *g_311 = &g_149.f4;
This commit is contained in:
parent
a9f7f97a2f
commit
2be0ef0de5
@ -1844,6 +1844,8 @@ var
|
|||||||
end {if}
|
end {if}
|
||||||
else if tree^.token.kind = dotch then begin
|
else if tree^.token.kind = dotch then begin
|
||||||
tp := Subscript(tree^.left);
|
tp := Subscript(tree^.left);
|
||||||
|
while tp^.kind = definedType do
|
||||||
|
tp := tp^.dType;
|
||||||
if tp^.kind in [structType,unionType] then begin
|
if tp^.kind in [structType,unionType] then begin
|
||||||
DoSelection(tp, tree^.right, select);
|
DoSelection(tp, tree^.right, select);
|
||||||
Subscript := expressionType;
|
Subscript := expressionType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user