mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-05-29 04:41:27 +00:00
Bump sym file version and add a couple sanity checks.
Bumping the version forces regeneration of any sym files created by old ORCA/C versions with the bug that was just fixed. A couple sanity checks are also introduced when reading sym files, including one that would have caught that bug.
This commit is contained in:
parent
62757acdb1
commit
411f911b60
|
@ -942,6 +942,7 @@ case errnum of {print the error}
|
||||||
9 : msg := concat('Error writing ', objFile.theString.theString);
|
9 : msg := concat('Error writing ', objFile.theString.theString);
|
||||||
10: msg := 'ORCA/C requires version 2.0 or later of the shell';
|
10: msg := 'ORCA/C requires version 2.0 or later of the shell';
|
||||||
11: msg := 'The program is too large to compile to memory -- use Compile to Disk';
|
11: msg := 'The program is too large to compile to memory -- use Compile to Disk';
|
||||||
|
12: msg := 'Invalid sym file detected. Re-run ORCA/C to proceed.';
|
||||||
otherwise: begin
|
otherwise: begin
|
||||||
msg := '';
|
msg := '';
|
||||||
Error(57);
|
Error(57);
|
||||||
|
|
13
Header.pas
13
Header.pas
|
@ -18,7 +18,7 @@ uses CCommon, MM, Scanner, Symbol, CGI;
|
||||||
{$segment 'SCANNER'}
|
{$segment 'SCANNER'}
|
||||||
|
|
||||||
const
|
const
|
||||||
symFileVersion = 2; {version number of .sym file format}
|
symFileVersion = 3; {version number of .sym file format}
|
||||||
|
|
||||||
var
|
var
|
||||||
inhibitHeader: boolean; {should .sym includes be blocked?}
|
inhibitHeader: boolean; {should .sym includes be blocked?}
|
||||||
|
@ -1647,6 +1647,7 @@ var
|
||||||
1: begin {read a type displacement}
|
1: begin {read a type displacement}
|
||||||
tdisp := typeDispList;
|
tdisp := typeDispList;
|
||||||
disp := ReadLong;
|
disp := ReadLong;
|
||||||
|
tp := nil;
|
||||||
while tdisp <> nil do
|
while tdisp <> nil do
|
||||||
if tdisp^.saveDisp = disp then begin
|
if tdisp^.saveDisp = disp then begin
|
||||||
tp := tdisp^.tPtr;
|
tp := tdisp^.tPtr;
|
||||||
|
@ -1654,6 +1655,11 @@ var
|
||||||
end {if}
|
end {if}
|
||||||
else
|
else
|
||||||
tdisp := tdisp^.next;
|
tdisp := tdisp^.next;
|
||||||
|
if tp = nil then begin
|
||||||
|
PurgeSymbols;
|
||||||
|
DestroySymbolFile;
|
||||||
|
TermError(12);
|
||||||
|
end; {if}
|
||||||
end; {case 1}
|
end; {case 1}
|
||||||
|
|
||||||
2: tp := bytePtr;
|
2: tp := bytePtr;
|
||||||
|
@ -1876,6 +1882,11 @@ if not ignoreSymbols then begin
|
||||||
end; {while}
|
end; {while}
|
||||||
DisposeTypeDispList;
|
DisposeTypeDispList;
|
||||||
saveSource := false;
|
saveSource := false;
|
||||||
|
if ord4(symPtr) > ord4(symEndPtr) then begin
|
||||||
|
PurgeSymbols;
|
||||||
|
DestroySymbolFile;
|
||||||
|
TermError(12);
|
||||||
|
end; {if}
|
||||||
end {if}
|
end {if}
|
||||||
else begin
|
else begin
|
||||||
PurgeSymbols; {no file found}
|
PurgeSymbols; {no file found}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user