mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 13:09:14 +02:00
FpDebug: fixed evaluating signed/unsigned mixed AND
git-svn-id: trunk@64387 -
This commit is contained in:
parent
78d7603454
commit
3f5954b07e
@ -272,6 +272,7 @@ type
|
||||
FValue: QWord;
|
||||
protected
|
||||
function GetAsCardinal: QWord; override;
|
||||
function GetAsInteger: Int64; override;
|
||||
procedure SetAsCardinal(AValue: QWord); override;
|
||||
function GetFieldFlags: TFpValueFieldFlags; override;
|
||||
end;
|
||||
@ -2155,6 +2156,11 @@ begin
|
||||
FValue := Result;
|
||||
end;
|
||||
|
||||
function TFpValueDwarfCardinal.GetAsInteger: Int64;
|
||||
begin
|
||||
Result := Int64(GetAsCardinal);
|
||||
end;
|
||||
|
||||
function TFpValueDwarfCardinal.GetFieldFlags: TFpValueFieldFlags;
|
||||
begin
|
||||
Result := inherited GetFieldFlags;
|
||||
|
@ -3090,13 +3090,12 @@ begin
|
||||
|
||||
{$PUSH}{$R-}{$Q-}
|
||||
case tmp1.Kind of
|
||||
skInteger: if tmp2.Kind in [skInteger, skCardinal] then
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsInteger AND tmp2.AsInteger, True);
|
||||
skCardinal: if tmp2.Kind = skInteger then
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsInteger AND tmp2.AsInteger, True)
|
||||
else
|
||||
if tmp2.Kind = skCardinal then
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsInteger AND tmp2.AsInteger, False);
|
||||
skInteger: if tmp2.Kind = skInteger then
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsInteger AND tmp2.AsInteger, True)
|
||||
else
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsCardinal AND tmp2.AsCardinal, False);
|
||||
skCardinal: if tmp2.Kind in [skInteger, skCardinal] then
|
||||
Result := TFpValueConstNumber.Create(tmp1.AsCardinal AND tmp2.AsCardinal, False);
|
||||
skBoolean: if tmp2.Kind = skBoolean then
|
||||
Result := TFpValueConstBool.Create(tmp1.AsBool AND tmp2.AsBool);
|
||||
end;
|
||||
|
@ -2103,6 +2103,14 @@ procedure TTestWatches.TestWatchesExpression;
|
||||
.skipIf((ALoc in [tlConst]) or (ALoc2 in [tlConst]));
|
||||
|
||||
|
||||
t.Add(AName, p+'Word'+e +' and '+ p+'LongWord'+e, weInteger((100+n) and (1000+n)) );
|
||||
t.Add(AName, p+'Word'+e +' and Byte('+ p+'Char'+e+')', weInteger((100+n) and Byte(AChr1)) );
|
||||
t.Add(AName, p+'Word'+e +' and '+ IntToStr(1002+n), weInteger((100+n) and (1002+n)) );
|
||||
t.Add(AName, p+'Word'+e +' and ShortInt('+ p+'Char'+e+')', weInteger((100+n) and Byte(AChr1)) );
|
||||
|
||||
t.Add(AName, p+'ShortInt'+e +' and '+ p+'SmallInt'+e, weInteger((50+n) and (500+n)) );
|
||||
t.Add(AName, p+'ShortInt'+e +' and '+ p+'Word'+e, weInteger((50+n) and (1000+n)) );
|
||||
t.Add(AName, p+'ShortInt'+e +' and '+ IntToStr(1002+n), weInteger((50+n) and (1002+n)) );
|
||||
|
||||
for i := 0 to t.Count-1 do
|
||||
t.Tests[i].IgnTypeName();
|
||||
|
Loading…
Reference in New Issue
Block a user