mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-04-07 17:37:11 +00:00
Prohibit static initializers referring to a non-static array element.
This covers code like the following: int main(void) { auto int a[20]; static int *p = &a[5]; } Previously, this would compile without error, and then either give a linker error or be linked to refer to the global symbol "a" (if there was one).
This commit is contained in:
parent
3a64c5b977
commit
2412ae0661
@ -2014,6 +2014,10 @@ var
|
||||
iPtr^.pName := @'?';
|
||||
end {if}
|
||||
else begin
|
||||
if ip^.storage in [stackFrame,parameter] then begin
|
||||
Error(41);
|
||||
errorFound := true;
|
||||
end; {if}
|
||||
Subscript := ip^.itype;
|
||||
iPtr^.pName := ip^.name;
|
||||
end; {else}
|
||||
|
Loading…
x
Reference in New Issue
Block a user