mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 09:34:12 +02:00
* do not use F field to get TObjectReader FileName as it is freed inside openfile method
git-svn-id: trunk@7255 -
This commit is contained in:
parent
41d171bda0
commit
390a4236e2
@ -57,6 +57,7 @@ type
|
|||||||
f : TCFileStream;
|
f : TCFileStream;
|
||||||
opened : boolean;
|
opened : boolean;
|
||||||
buf : pchar;
|
buf : pchar;
|
||||||
|
ffilename : string;
|
||||||
bufidx,
|
bufidx,
|
||||||
bufmax : longint;
|
bufmax : longint;
|
||||||
function readbuf:boolean;
|
function readbuf:boolean;
|
||||||
@ -217,6 +218,7 @@ begin
|
|||||||
buf:=nil;
|
buf:=nil;
|
||||||
bufidx:=0;
|
bufidx:=0;
|
||||||
bufmax:=0;
|
bufmax:=0;
|
||||||
|
ffilename:='';
|
||||||
opened:=false;
|
opened:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -237,6 +239,7 @@ begin
|
|||||||
Comment(V_Error,'Can''t open object file: '+fn);
|
Comment(V_Error,'Can''t open object file: '+fn);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
ffilename:=fn;
|
||||||
getmem(buf,f.Size);
|
getmem(buf,f.Size);
|
||||||
f.read(buf^,f.Size);
|
f.read(buf^,f.Size);
|
||||||
bufmax:=f.Size;
|
bufmax:=f.Size;
|
||||||
@ -295,7 +298,7 @@ end;
|
|||||||
|
|
||||||
function tobjectreader.getfilename : string;
|
function tobjectreader.getfilename : string;
|
||||||
begin
|
begin
|
||||||
result:=f.filename;
|
result:=ffilename;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user