mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 14:49:28 +02:00
FpDebug: Array-slices [n..m], check if they are in active part of condition. If not, don't create multiple results.
This commit is contained in:
parent
c4deaeadcf
commit
64b2dbfaea
@ -657,6 +657,7 @@ type
|
||||
private
|
||||
FCurrentIndex: Int64;
|
||||
protected
|
||||
FTouched: boolean;
|
||||
procedure Init; override;
|
||||
procedure SetParent(AValue: TFpPascalExpressionPartContainer); override;
|
||||
function DoGetResultValue: TFpValue; override;
|
||||
@ -6584,6 +6585,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FSlicePart.FCurrentIndex := FSlicePart.StartValue;
|
||||
FSlicePart.FTouched := False;
|
||||
Result := Items[0].ResultValue;
|
||||
|
||||
if not FSlicePart.FTouched then begin
|
||||
// The array slice is not part of the expression ("? :" or Try)
|
||||
Result.AddReference;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if not FCheckedForVariantPart then begin
|
||||
FSlicePart.CheckForVariantExpressionParts;
|
||||
FCheckedForVariantPart := True;
|
||||
@ -6640,6 +6651,7 @@ end;
|
||||
|
||||
function TFpPascalExpressionPartOperatorArraySlice.DoGetResultValue: TFpValue;
|
||||
begin
|
||||
FTouched := True;
|
||||
Result := TFpValueConstNumber.Create(QWord(FCurrentIndex), True);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user