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;
const
SimbaVersion = 656;
SimbaVersion = 660;
type

View File

@ -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);

View File

@ -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;