diff --git a/Expression.pas b/Expression.pas index a66116b..10f9a0e 100644 --- a/Expression.pas +++ b/Expression.pas @@ -4526,7 +4526,16 @@ case tree^.token.kind of pType^.elements := pType^.size div pType^.aType^.size; end; {with} expressionType := tType; - end; {if} + end {if} + else if expressionType^.kind = arrayType then begin + tType := pointer(Malloc(sizeof(typeRecord))); + tType^.size := cgPointerSize; + tType^.saveDisp := 0; + tType^.qualifiers := []; + tType^.kind := pointerType; + tType^.pType := expressionType^.aType; + expressionType := tType; + end; {else if} end; {case uand} uasterisk: begin {unary * (indirection)} diff --git a/cc.notes b/cc.notes index 920cc41..259c611 100644 --- a/cc.notes +++ b/cc.notes @@ -1819,6 +1819,12 @@ int foo(int[42]); 186. Expressions like &"string" were treated as having an incorrect type. They should have the type char(*)[N], where N is the length of the string, including terminating null character. This led to spurious "type conflict" errors. +187. Expressions like sizeof(&*a), where a is an array, would generally give the wrong size. They should give the size of a pointer to the first element, not the size of the whole array. + +188. Expressions like sizeof(&*"string") would cause a spurious error. + +(Devin Reade) + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.