mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 23:29:27 +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}
|
||||
else if tree^.token.kind = dotch then begin
|
||||
tp := Subscript(tree^.left);
|
||||
while tp^.kind = definedType do
|
||||
tp := tp^.dType;
|
||||
if tp^.kind in [structType,unionType] then begin
|
||||
DoSelection(tp, tree^.right, select);
|
||||
Subscript := expressionType;
|
||||
|
Loading…
Reference in New Issue
Block a user