Allow dereferencing pointers to const struct or const union types.

This fixes the bug in the compca03.c test case.
This commit is contained in:
Stephen Heumann 2015-12-30 21:30:44 -06:00
parent c4360c70a1
commit c788052b99
1 changed files with 3 additions and 1 deletions

View File

@ -3456,7 +3456,9 @@ case tree^.token.kind of
else if lType^.kind = pointerType then
Gen1t(pc_ind, 0, cgULong)
else if not
(lType^.kind in [functionType,arrayType,structType,unionType]) then
((lType^.kind in [functionType,arrayType,structType,unionType])
or ((lType^.kind = definedType) and {handle const struct/union}
(lType^.dType^.kind in [structType,unionType]))) then
Error(79);
end {if}
else if not (lType^.kind in [structType,unionType]) then