mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-06 15:35:39 +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}
|
||||
|
||||
begin {LoadScalar}
|
||||
if id^.itype^.kind = pointerType then
|
||||
tp := cgULong
|
||||
else
|
||||
tp := id^.itype^.baseType;
|
||||
if id^.itype^.kind = scalarType then
|
||||
tp := id^.itype^.baseType
|
||||
else {if id^.itype^.kind in [pointerType,arrayType] then}
|
||||
tp := cgULong;
|
||||
case id^.storage of
|
||||
stackFrame, parameter:
|
||||
Gen2t(pc_lod, id^.lln, 0, tp);
|
||||
@ -2521,7 +2521,7 @@ var
|
||||
goto 1;
|
||||
end; {if}
|
||||
end {if}
|
||||
else {if iType^.kind = pointerType then} begin
|
||||
else {if iType^.kind in [pointerType,arrayType] then} begin
|
||||
lSize := iType^.pType^.size;
|
||||
if lSize = 0 then
|
||||
Error(122);
|
||||
|
Loading…
Reference in New Issue
Block a user