mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 10:26:17 +02:00
Set string length before calling move to avoid problems with global data analysis on systems using C library
git-svn-id: trunk@49280 -
This commit is contained in:
parent
7721995c71
commit
77e3a402da
@ -1403,8 +1403,8 @@ Implementation
|
|||||||
len:=p-pstart;
|
len:=p-pstart;
|
||||||
if len>255 then
|
if len>255 then
|
||||||
internalerror(200509187);
|
internalerror(200509187);
|
||||||
move(pstart^,hs[1],len);
|
|
||||||
hs[0]:=chr(len);
|
hs[0]:=chr(len);
|
||||||
|
move(pstart^,hs[1],len);
|
||||||
sym:=objdata.symbolref(hs);
|
sym:=objdata.symbolref(hs);
|
||||||
{ Second symbol? }
|
{ Second symbol? }
|
||||||
if assigned(relocsym) then
|
if assigned(relocsym) then
|
||||||
|
@ -2063,6 +2063,8 @@ const pemagic : array[0..3] of byte = (
|
|||||||
FCoffSyms.Read(bosym,sizeof(bosym));
|
FCoffSyms.Read(bosym,sizeof(bosym));
|
||||||
if bosym.Name.Offset.Zeroes<>0 then
|
if bosym.Name.Offset.Zeroes<>0 then
|
||||||
begin
|
begin
|
||||||
|
{ Added for sake of global data analysis }
|
||||||
|
strname[0]:=#0;
|
||||||
move(bosym.Name.ShortName,strname[1],8);
|
move(bosym.Name.ShortName,strname[1],8);
|
||||||
strname[9]:=#0;
|
strname[9]:=#0;
|
||||||
strname[0]:=chr(strlen(@strname[1]));
|
strname[0]:=chr(strlen(@strname[1]));
|
||||||
@ -2081,6 +2083,8 @@ const pemagic : array[0..3] of byte = (
|
|||||||
FCoffSyms.Read(sym,sizeof(sym));
|
FCoffSyms.Read(sym,sizeof(sym));
|
||||||
if plongint(@sym.name)^<>0 then
|
if plongint(@sym.name)^<>0 then
|
||||||
begin
|
begin
|
||||||
|
{ Added for sake of global data analysis }
|
||||||
|
strname[0]:=#0;
|
||||||
move(sym.name,strname[1],8);
|
move(sym.name,strname[1],8);
|
||||||
strname[9]:=#0;
|
strname[9]:=#0;
|
||||||
strname[0]:=chr(strlen(@strname[1]));
|
strname[0]:=chr(strlen(@strname[1]));
|
||||||
|
Loading…
Reference in New Issue
Block a user