summaryrefslogtreecommitdiff
path: root/compiler/ogcoff.pas
diff options
context:
space:
mode:
authorpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 14:52:22 +0000
committerpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 14:52:22 +0000
commit6b13fc7eb4cf5316977817b48ac8e28729e11228 (patch)
tree1e56e7f255ef5abb9c2079bafffbeba299b27d2a /compiler/ogcoff.pas
parent1cf576df7b09c8e02c6608281807fd95b6813160 (diff)
downloadfpc-6b13fc7eb4cf5316977817b48ac8e28729e11228.tar.gz
Set string length before calling move to avoid problems with global data analysis on systems using C library
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49280 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ogcoff.pas')
-rw-r--r--compiler/ogcoff.pas4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ogcoff.pas b/compiler/ogcoff.pas
index 879eb0ca25..e5d9fd0844 100644
--- a/compiler/ogcoff.pas
+++ b/compiler/ogcoff.pas
@@ -2063,6 +2063,8 @@ const pemagic : array[0..3] of byte = (
FCoffSyms.Read(bosym,sizeof(bosym));
if bosym.Name.Offset.Zeroes<>0 then
begin
+ { Added for sake of global data analysis }
+ strname[0]:=#0;
move(bosym.Name.ShortName,strname[1],8);
strname[9]:=#0;
strname[0]:=chr(strlen(@strname[1]));
@@ -2081,6 +2083,8 @@ const pemagic : array[0..3] of byte = (
FCoffSyms.Read(sym,sizeof(sym));
if plongint(@sym.name)^<>0 then
begin
+ { Added for sake of global data analysis }
+ strname[0]:=#0;
move(sym.name,strname[1],8);
strname[9]:=#0;
strname[0]:=chr(strlen(@strname[1]));