mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-21 21:32:00 +00:00
When arrays are declared using a typedef'd incomplete array type, don't fix the size for all arrays of that type based on the initializer of the first array using it.
This fixes the compca07.c test case.
This commit is contained in:
parent
78493936bc
commit
c77bca8389
@ -3505,6 +3505,13 @@ else {if not isFunction then} begin
|
||||
Error(52);
|
||||
if doingPrototypes then
|
||||
Error(88);
|
||||
{allocate copy of incomplete array type,}
|
||||
tp := variable^.itype; {so it can be completed by Initializer}
|
||||
if (tp^.kind = arrayType) and (tp^.elements = 0) then begin
|
||||
variable^.itype := pointer(Malloc(sizeof(typeRecord)));
|
||||
variable^.itype^ := tp^;
|
||||
variable^.itype^.saveDisp := 0;
|
||||
end;
|
||||
NextToken; {handle an initializer}
|
||||
ltypeSpec := typeSpec;
|
||||
Initializer(variable);
|
||||
|
Loading…
x
Reference in New Issue
Block a user