mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-18 03:29:49 +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);
|
||||
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';
|
||||
12: msg := 'Invalid sym file detected. Re-run ORCA/C to proceed.';
|
||||
otherwise: begin
|
||||
msg := '';
|
||||
Error(57);
|
||||
|
13
Header.pas
13
Header.pas
@ -18,7 +18,7 @@ uses CCommon, MM, Scanner, Symbol, CGI;
|
||||
{$segment 'SCANNER'}
|
||||
|
||||
const
|
||||
symFileVersion = 2; {version number of .sym file format}
|
||||
symFileVersion = 3; {version number of .sym file format}
|
||||
|
||||
var
|
||||
inhibitHeader: boolean; {should .sym includes be blocked?}
|
||||
@ -1647,6 +1647,7 @@ var
|
||||
1: begin {read a type displacement}
|
||||
tdisp := typeDispList;
|
||||
disp := ReadLong;
|
||||
tp := nil;
|
||||
while tdisp <> nil do
|
||||
if tdisp^.saveDisp = disp then begin
|
||||
tp := tdisp^.tPtr;
|
||||
@ -1654,6 +1655,11 @@ var
|
||||
end {if}
|
||||
else
|
||||
tdisp := tdisp^.next;
|
||||
if tp = nil then begin
|
||||
PurgeSymbols;
|
||||
DestroySymbolFile;
|
||||
TermError(12);
|
||||
end; {if}
|
||||
end; {case 1}
|
||||
|
||||
2: tp := bytePtr;
|
||||
@ -1876,6 +1882,11 @@ if not ignoreSymbols then begin
|
||||
end; {while}
|
||||
DisposeTypeDispList;
|
||||
saveSource := false;
|
||||
if ord4(symPtr) > ord4(symEndPtr) then begin
|
||||
PurgeSymbols;
|
||||
DestroySymbolFile;
|
||||
TermError(12);
|
||||
end; {if}
|
||||
end {if}
|
||||
else begin
|
||||
PurgeSymbols; {no file found}
|
||||
|
Loading…
x
Reference in New Issue
Block a user