From c788052b99036444b1401b1c033df13455fe3e6f Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Wed, 30 Dec 2015 21:30:44 -0600 Subject: [PATCH] Allow dereferencing pointers to const struct or const union types. This fixes the bug in the compca03.c test case. --- Expression.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Expression.pas b/Expression.pas index a2fb0de..ec103b8 100644 --- a/Expression.pas +++ b/Expression.pas @@ -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