mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-08 13:29:54 +00:00
Don't generate scalar load operations with bogus types.
This could occur with some operations on function parameters declared with array types, in some cases leading to compiler errors. Fixes #61.
This commit is contained in:
parent
6bd600157d
commit
1a2e4772cd
@ -1963,10 +1963,10 @@ var
|
|||||||
tp: baseTypeEnum; {base type}
|
tp: baseTypeEnum; {base type}
|
||||||
|
|
||||||
begin {LoadScalar}
|
begin {LoadScalar}
|
||||||
if id^.itype^.kind = pointerType then
|
if id^.itype^.kind = scalarType then
|
||||||
tp := cgULong
|
tp := id^.itype^.baseType
|
||||||
else
|
else {if id^.itype^.kind in [pointerType,arrayType] then}
|
||||||
tp := id^.itype^.baseType;
|
tp := cgULong;
|
||||||
case id^.storage of
|
case id^.storage of
|
||||||
stackFrame, parameter:
|
stackFrame, parameter:
|
||||||
Gen2t(pc_lod, id^.lln, 0, tp);
|
Gen2t(pc_lod, id^.lln, 0, tp);
|
||||||
@ -2521,7 +2521,7 @@ var
|
|||||||
goto 1;
|
goto 1;
|
||||||
end; {if}
|
end; {if}
|
||||||
end {if}
|
end {if}
|
||||||
else {if iType^.kind = pointerType then} begin
|
else {if iType^.kind in [pointerType,arrayType] then} begin
|
||||||
lSize := iType^.pType^.size;
|
lSize := iType^.pType^.size;
|
||||||
if lSize = 0 then
|
if lSize = 0 then
|
||||||
Error(122);
|
Error(122);
|
||||||
|
Loading…
Reference in New Issue
Block a user