diff --git a/Projects/SAMufasaGUI/testunit.pas b/Projects/SAMufasaGUI/testunit.pas index e1f37d7..c2425a4 100644 --- a/Projects/SAMufasaGUI/testunit.pas +++ b/Projects/SAMufasaGUI/testunit.pas @@ -46,7 +46,7 @@ uses CastaliaSimplePasPar, v_AutoCompleteForm, PSDump; const - SimbaVersion = 656; + SimbaVersion = 660; type diff --git a/Units/PascalScript/uPSRuntime.pas b/Units/PascalScript/uPSRuntime.pas index 49d96a6..0790bf6 100644 --- a/Units/PascalScript/uPSRuntime.pas +++ b/Units/PascalScript/uPSRuntime.pas @@ -10208,7 +10208,7 @@ begin v := NewPPSVariantIFC(Stack[CurrStack + 1], True); end else v := nil; try - Result := Caller.InnerfuseCall(FSelf, VirtualClassMethodPtrToPtr(p.Ext1, FSelf), cc, MyList, v); + Result := Caller.InnerfuseCall(FSelf, VirtualClassMethodPtrToPtr(p.Ext1, FSelf), TPSCallingConvention(Integer(cc) or 128), MyList, v); finally DisposePPSVariantIFC(v); DisposePPSVariantIFCList(mylist); diff --git a/Units/PascalScript/x86.inc b/Units/PascalScript/x86.inc index 61dc4ec..e88053e 100644 --- a/Units/PascalScript/x86.inc +++ b/Units/PascalScript/x86.inc @@ -252,7 +252,7 @@ var CallData: TPSList; pp: ^Byte; {$IFDEF FPC} - IsConstructor: Boolean; + IsConstructor,IsVirtualCons: Boolean; {$ENDIF} EAX, EDX, ECX: Longint; @@ -503,6 +503,18 @@ var Result := True; end; begin + if (Integer(CallingConv) and 128) <> 0 then + begin + {$ifdef FPC} + IsVirtualCons := true; + {$endif} + CAllingConv := TPSCallingConvention(Integer(CallingConv) and not 128); + end else + begin + {$ifdef FPC} + IsVirtualCons:= false + {$endif} + end; if (Integer(CallingConv) and 64) <> 0 then begin {$IFDEF FPC} IsConstructor := true; @@ -575,11 +587,12 @@ begin btClass : begin {$IFDEF FPC} - if IsConstructor then + if IsConstructor or IsVirtualCons then tbtu32(res.dta^) := RealCall_Register(Address, EDX, EAX, ECX, @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil) else - {$ENDIF} + {$ENDIF} +// {$ELSE} tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil); end;