From d2c5176f59cbaa1aea9b51bb0d90468bc281b8db Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 14 Jan 2015 18:22:48 +0000 Subject: [PATCH] PascalScript: update to origin git 466ab97b370687e7053a945d0a55aef7f260e7f3 git-svn-id: trunk@47387 - --- components/PascalScript/Source/PascalScriptFPC.inc | 5 ++--- components/PascalScript/Source/uPSCompiler.pas | 3 +++ components/PascalScript/Source/uPSRuntime.pas | 11 +++++++++++ components/PascalScript/Source/x86.inc | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/components/PascalScript/Source/PascalScriptFPC.inc b/components/PascalScript/Source/PascalScriptFPC.inc index 942f2e0969..219de825ff 100644 --- a/components/PascalScript/Source/PascalScriptFPC.inc +++ b/components/PascalScript/Source/PascalScriptFPC.inc @@ -4,15 +4,14 @@ {$ifndef mswindows} {$DEFINE PS_NOIDISPATCH} {$endif} - {.$if (fpc_version=2) and (fpc_release>=3) and (fpc_patch>=1)} - {$if (fpc_version=2) and ((fpc_release=2) and (fpc_patch>=4)) or (fpc_release>2)} + {$if (fpc_version>2) or ((fpc_version=2) and ((fpc_release=2) and (fpc_patch>=4)) or (fpc_release>2))} {$UNDEF FPC_OLD_FIX} {$DEFINE PS_STACKALIGN} {$UNDEF PS_FPCSTRINGWORKAROUND} {$DEFINE PS_RESBEFOREPARAMETERS} {$DEFINE x64_string_result_as_varparameter} {$ifdef mswindows} - {$if (fpc_version=2) and (fpc_release>5)} + {$if (fpc_version>2) or ((fpc_version=2) and (fpc_release>5))} {$DEFINE PS_FPC_HAS_COM} {$endif} {$endif} diff --git a/components/PascalScript/Source/uPSCompiler.pas b/components/PascalScript/Source/uPSCompiler.pas index 981c7ce1a7..9a4bacdcac 100644 --- a/components/PascalScript/Source/uPSCompiler.pas +++ b/components/PascalScript/Source/uPSCompiler.pas @@ -13143,6 +13143,9 @@ begin {$ENDIF} AddDelphiFunction('function Unassigned: Variant;'); AddDelphiFunction('function VarIsEmpty(const V: Variant): Boolean;'); +{$IFDEF DELPHI7UP} + AddDelphiFunction('function VarIsClear(const V: Variant): Boolean;'); +{$ENDIF} AddDelphiFunction('function Null: Variant;'); AddDelphiFunction('function VarIsNull(const V: Variant): Boolean;'); AddDelphiFunction('function VarType(const V: Variant): TVarType;'); diff --git a/components/PascalScript/Source/uPSRuntime.pas b/components/PascalScript/Source/uPSRuntime.pas index 86a000e62d..c29b6a653b 100644 --- a/components/PascalScript/Source/uPSRuntime.pas +++ b/components/PascalScript/Source/uPSRuntime.pas @@ -9374,6 +9374,9 @@ begin RegisterDelphiFunction(@Unassigned, 'UNASSIGNED', cdRegister); RegisterDelphiFunction(@VarIsEmpty, 'VARISEMPTY', cdRegister); + {$IFDEF DELPHI7UP} + RegisterDelphiFunction(@VarIsClear, 'VARISCLEAR', cdRegister); + {$ENDIF} RegisterDelphiFunction(@Null, 'NULL', cdRegister); RegisterDelphiFunction(@VarIsNull, 'VARISNULL', cdRegister); {$IFNDEF FPC} @@ -9930,10 +9933,18 @@ end; procedure CheckPackagePtr(var P: PByteArr); begin + {$ifdef Win32} if (word((@p[0])^) = $25FF) and (word((@p[6])^)=$C08B)then begin p := PPointer((@p[2])^)^; end; + {$endif} + {$ifdef Win64} + if (word((@p[0])^) = $25FF) {and (word((@p[6])^)=$C08B)}then + begin + p := PPointer(NativeUInt(@P[0]) + Cardinal((@p[2])^) + 6{Instruction Size})^ + end; + {$endif} end; {$IFDEF VER90}{$DEFINE NO_vmtSelfPtr}{$ENDIF} diff --git a/components/PascalScript/Source/x86.inc b/components/PascalScript/Source/x86.inc index 3f42111c32..6f098d8065 100644 --- a/components/PascalScript/Source/x86.inc +++ b/components/PascalScript/Source/x86.inc @@ -543,6 +543,7 @@ begin if not GetPtr(rp(Params[0])) then exit; // this goes first RegUsage := 2; EDX := Longint(_Self); + DisposePPSVariantIFC(Params[0]); Params.Delete(0); end else {$ENDIF}