diff --git a/Source/PascalScriptFPC.inc b/Source/PascalScriptFPC.inc index f73780a..7857ae9 100644 --- a/Source/PascalScriptFPC.inc +++ b/Source/PascalScriptFPC.inc @@ -9,6 +9,7 @@ {$UNDEF PS_FPCSTRINGWORKAROUND} {$DEFINE PS_RESBEFOREPARAMETERS} {$DEFINE x64_string_result_as_varparameter} + {$DEFINE PS_RESULTFIRST} {FreePascal 2.3.1 and above has much Delphi compatibility bugs fixed} {$else} {$DEFINE FPC_OLD_FIX} diff --git a/Source/x86.inc b/Source/x86.inc index 38289a7..8f25452 100644 --- a/Source/x86.inc +++ b/Source/x86.inc @@ -541,12 +541,12 @@ begin RegUsage := 1; EAX := Longint(_Self); end; - +{$IFNDEF PS_RESULTFIRST} for I := 0 to Params.Count - 1 do begin if not GetPtr(rp(Params[I])) then Exit; end; - +{$ENDIF} if assigned(res) then begin case res^.aType.BaseType of {$IFNDEF PS_NOWIDESTRING}btWideString, btUnicodeString, {$ENDIF} @@ -556,6 +556,12 @@ begin if TPSTypeRec_Set(res.aType).aByteSize >4 then GetPtr(res); end; end; +{$IFDEF PS_RESULTFIRST} + for I := 0 to Params.Count - 1 do + begin + if not GetPtr(rp(Params[I])) then Exit; + end; +{$ENDIF} case res^.aType.BaseType of btSet: begin