Fixed bug in Constructors for PS.

This commit is contained in:
Raymond 2010-05-09 23:37:28 +02:00
parent b6f2d14ca2
commit 07aca712a6
3 changed files with 18 additions and 5 deletions

View File

@ -46,7 +46,7 @@ uses
CastaliaSimplePasPar, v_AutoCompleteForm, PSDump; CastaliaSimplePasPar, v_AutoCompleteForm, PSDump;
const const
SimbaVersion = 656; SimbaVersion = 660;
type type

View File

@ -10208,7 +10208,7 @@ begin
v := NewPPSVariantIFC(Stack[CurrStack + 1], True); v := NewPPSVariantIFC(Stack[CurrStack + 1], True);
end else v := nil; end else v := nil;
try 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 finally
DisposePPSVariantIFC(v); DisposePPSVariantIFC(v);
DisposePPSVariantIFCList(mylist); DisposePPSVariantIFCList(mylist);

View File

@ -252,7 +252,7 @@ var
CallData: TPSList; CallData: TPSList;
pp: ^Byte; pp: ^Byte;
{$IFDEF FPC} {$IFDEF FPC}
IsConstructor: Boolean; IsConstructor,IsVirtualCons: Boolean;
{$ENDIF} {$ENDIF}
EAX, EDX, ECX: Longint; EAX, EDX, ECX: Longint;
@ -503,6 +503,18 @@ var
Result := True; Result := True;
end; end;
begin 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 if (Integer(CallingConv) and 64) <> 0 then begin
{$IFDEF FPC} {$IFDEF FPC}
IsConstructor := true; IsConstructor := true;
@ -575,11 +587,12 @@ begin
btClass : btClass :
begin begin
{$IFDEF FPC} {$IFDEF FPC}
if IsConstructor then if IsConstructor or IsVirtualCons then
tbtu32(res.dta^) := RealCall_Register(Address, EDX, EAX, ECX, tbtu32(res.dta^) := RealCall_Register(Address, EDX, EAX, ECX,
@Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil) @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil)
else else
{$ENDIF} {$ENDIF}
// {$ELSE}
tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX,
@Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil); @Stack[Length(Stack) - 3], Length(Stack) div 4, 4, nil);
end; end;