Merge pull request #2 from ksherlock/GetTypDisp-bug

GetTypeDisp bug
This commit is contained in:
MikeW50 2018-03-25 15:11:48 -06:00 committed by GitHub
commit 4736864a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -753,6 +753,9 @@ procedure GenSymbols {sym: ctp; doGlobals: integer};
{ } { }
{ Notes: Defined as extern in Native.pas } { Notes: Defined as extern in Native.pas }
const
noDisp = -1; {disp returned by GetTypeDisp if the type was not found}
type type
tpPtr = ^tpRecord; {type list displacements} tpPtr = ^tpRecord; {type list displacements}
tpRecord = record tpRecord = record
@ -794,7 +797,7 @@ var
if tp2 <> nil then if tp2 <> nil then
GetTypeDisp := tp2^.disp {return disp to entry} GetTypeDisp := tp2^.disp {return disp to entry}
else begin else begin
GetTypeDisp := 0; {no entry} GetTypeDisp := noDisp; {no entry}
new(tp1); {create a new entry} new(tp1); {create a new entry}
tp1^.next := tpList; tp1^.next := tpList;
tpList := tp1; tpList := tp1;
@ -1033,7 +1036,7 @@ var
records, records,
objects: begin objects: begin
disp := GetTypeDisp(tp^.eltype); disp := GetTypeDisp(tp^.eltype);
if disp = 0 then begin if disp = noDisp then begin
if tp^.eltype^.form = records then if tp^.eltype^.form = records then
CnOut(12) CnOut(12)
else else
@ -1072,7 +1075,7 @@ var
records, records,
objects: begin objects: begin
disp := GetTypeDisp(sym^.idtype); disp := GetTypeDisp(sym^.idtype);
if disp = 0 then begin if disp = noDisp then begin
if sym^.idtype^.form = records then if sym^.idtype^.form = records then
CnOut(12) CnOut(12)
else else