* Do not test variants with equal memory area: e.g. strings may point to different memory areas

This commit is contained in:
Michaël Van Canneyt 2023-06-07 11:56:46 +02:00 committed by Sven/Sarah Barth
parent b6a87450eb
commit 85524ff821

View File

@ -241,15 +241,15 @@ begin
{$ifdef fpc}
tkObject,
{$endif}
tkMethod,
tkVariant: begin
tkMethod:
begin
if aValue1.DataSize = aValue2.DataSize then
Result := CompareMem(aValue1.GetReferenceToRawData, aValue2.GetReferenceToRawData, aValue1.DataSize)
else
Result := False;
end
else
Result := False;
end;
tkVariant:
Result := aValue1.AsVariant = aValue2.AsVariant;
end;
end else
Result := False;