mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-05 02:07:22 +00:00
Avoid null pointer dereferences when processing K&R-style function parameter declarations.
These are initially entered into the symbol table with no known type (itype = nil), so this case should be accounted for in NewSymbol. This typically would not cause a problem, but might if the zero page contained certain values
This commit is contained in:
parent
b88dc5b39c
commit
a4f7284a8a
@ -1352,7 +1352,7 @@ lUseGlobalPool := useGlobalPool;
|
||||
tk.name := name;
|
||||
tk.symbolPtr := nil;
|
||||
if space <> fieldListSpace then begin {are we defining a function?}
|
||||
if itype^.kind = functionType then begin
|
||||
if (itype <> nil) and (itype^.kind = functionType) then begin
|
||||
isGlobal := true;
|
||||
useGlobalPool := true;
|
||||
if class in [autosy, ident] then
|
||||
@ -1376,8 +1376,8 @@ if space <> fieldListSpace then begin {are we defining a function?}
|
||||
end; {if}
|
||||
end; {if}
|
||||
end {if}
|
||||
else if (itype^.kind in [structType,unionType]) and (itype^.fieldList = nil)
|
||||
and doingParameters then begin
|
||||
else if (itype <> nil) and (itype^.kind in [structType,unionType])
|
||||
and (itype^.fieldList = nil) and doingParameters then begin
|
||||
useGlobalPool := true;
|
||||
end; {else if}
|
||||
if noDeclarations then begin {if we need a symbol table, create it}
|
||||
|
Loading…
Reference in New Issue
Block a user