Preserve qualifiers when changing float/double/comp parameters to extended.

Changing the type is still non-standard, but at least this allows us to detect and report write-to-const errors.
This commit is contained in:
Stephen Heumann 2022-01-14 18:52:13 -06:00
parent 6f0b94bb7c
commit 8eda03436a
1 changed files with 2 additions and 1 deletions

View File

@ -3885,7 +3885,8 @@ if isFunction then begin
if lp^.itype^.kind = scalarType then
if lp^.itype^.baseType in [cgReal,cgDouble,cgComp] then
{all floating-points are passed as extended}
lp^.itype := extendedPtr;
lp^.itype :=
MakeQualifiedType(extendedPtr, lp^.itype^.qualifiers);
nextPdisp := nextPdisp + long(lp^.itype^.size).lsw;
if (long(lp^.itype^.size).lsw = 1)
and (lp^.itype^.kind = scalarType) then