Skip to content

Commit dee65df

Browse files
committed
Prevent access violation on GetVarValue
1 parent 9ae24fd commit dee65df

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Source/PascalScript_Core_D27.dpk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ package PascalScript_Core_D27;
99
{$EXTENDEDSYNTAX ON}
1010
{$IMPORTEDDATA ON}
1111
{$IOCHECKS ON}
12-
{$LOCALSYMBOLS ON}
12+
{$LOCALSYMBOLS OFF}
1313
{$LONGSTRINGS ON}
1414
{$OPENSTRINGS ON}
15-
{$OPTIMIZATION OFF}
15+
{$OPTIMIZATION ON}
1616
{$OVERFLOWCHECKS OFF}
1717
{$RANGECHECKS OFF}
18-
{$REFERENCEINFO ON}
18+
{$REFERENCEINFO OFF}
1919
{$SAFEDIVIDE OFF}
2020
{$STACKFRAMES ON}
2121
{$TYPEDADDRESS OFF}
2222
{$VARSTRINGCHECKS ON}
2323
{$WRITEABLECONST OFF}
2424
{$MINENUMSIZE 1}
2525
{$IMAGEBASE $400000}
26-
{$DEFINE DEBUG}
26+
{$DEFINE RELEASE}
2727
{$ENDIF IMPLICITBUILDING}
2828
{$DESCRIPTION 'RemObjects Pascal Script - Core Package'}
2929
{$IMPLICITBUILD OFF}

Source/PascalScript_Core_D27.dproj

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Base>True</Base>
66
<Config Condition="'$(Config)'==''">Release</Config>
77
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
8-
<ProjectVersion>19.0</ProjectVersion>
8+
<ProjectVersion>19.2</ProjectVersion>
99
<FrameworkType>VCL</FrameworkType>
1010
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1111
<AppType>Package</AppType>
@@ -64,16 +64,10 @@
6464
</PropertyGroup>
6565
<PropertyGroup Condition="'$(Base_Win32)'!=''">
6666
<DCC_Namespace>System.Win;$(DCC_Namespace)</DCC_Namespace>
67-
<DCC_BplOutput>..\Dcu\D27\win32</DCC_BplOutput>
68-
<DCC_UnitSearchPath>..\Dcu\D27\win32;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
69-
<DCC_DcpOutput>..\Dcu\D27\win32</DCC_DcpOutput>
7067
<DCC_DcuOutput>..\Dcu\D27\win32</DCC_DcuOutput>
7168
<DCC_UsePackage>vcl;PascalScript_Core_D27;$(DCC_UsePackage)</DCC_UsePackage>
7269
</PropertyGroup>
7370
<PropertyGroup Condition="'$(Base_Win64)'!=''">
74-
<DCC_BplOutput>..\Dcu\D27\win64</DCC_BplOutput>
75-
<DCC_UnitSearchPath>..\Dcu\D27\win64;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
76-
<DCC_DcpOutput>..\Dcu\D27\win64</DCC_DcpOutput>
7771
<DCC_DcuOutput>..\Dcu\D27\win64</DCC_DcuOutput>
7872
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
7973
<DCC_UsePackage>vcl;$(DCC_UsePackage)</DCC_UsePackage>
@@ -189,7 +183,10 @@
189183
<VersionInfoKeys Name="Comments"/>
190184
<VersionInfoKeys Name="CompileDate">Friday, March 21, 2008 1:24 PM</VersionInfoKeys>
191185
</VersionInfoKeys>
192-
<Excluded_Packages/>
186+
<Excluded_Packages>
187+
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
188+
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
189+
</Excluded_Packages>
193190
</Delphi.Personality>
194191
<Platforms>
195192
<Platform value="Win32">True</Platform>

Source/uPSComponent.pas

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,15 +1336,18 @@ function TPSScriptDebugger.GetVarValue(const Name: tbtstring): Pointer;
13361336
s := '';
13371337
end;
13381338
pv := nil;
1339-
for i := 0 to Exec.CurrentProcVars.Count -1 do
1339+
if Exec.CurrentProcVars <> nil then
13401340
begin
1341-
if Uppercase(Exec.CurrentProcVars[i]) = s1 then
1341+
for i := 0 to Exec.CurrentProcVars.Count -1 do
13421342
begin
1343-
pv := Exec.GetProcVar(i);
1344-
break;
1343+
if Uppercase(Exec.CurrentProcVars[i]) = s1 then
1344+
begin
1345+
pv := Exec.GetProcVar(i);
1346+
break;
1347+
end;
13451348
end;
13461349
end;
1347-
if pv = nil then
1350+
if (pv = nil) and (Exec.CurrentProcParams <> nil) then
13481351
begin
13491352
for i := 0 to Exec.CurrentProcParams.Count -1 do
13501353
begin
@@ -1355,11 +1358,11 @@ function TPSScriptDebugger.GetVarValue(const Name: tbtstring): Pointer;
13551358
end;
13561359
end;
13571360
end;
1358-
if pv = nil then
1361+
if (pv = nil) and (Exec.GlobalVarNames <> nil) then
13591362
begin
13601363
for i := 0 to Exec.GlobalVarNames.Count -1 do
13611364
begin
1362-
if Uppercase(Exec.GlobalVarNames[i]) = s1 then
1365+
if Uppercase(Exec.GlobalVarNames[i]) = s1 then
13631366
begin
13641367
pv := Exec.GetGlobalVar(i);
13651368
break;

0 commit comments

Comments
 (0)