CopyArray is buggy for object
Original Reporter info from Mantis: hnb
-
Reporter name: Maciej Izak
Original Reporter info from Mantis: hnb
- Reporter name: Maciej Izak
Description:
Patch attached in #31249 (closed). #31249 (closed) is very important for low level libraries like mORMot - without access for INIT RTTI (like for records) CopyArray works improper for objects... Example:
===code begin===
{$MODE DELPHI}
type
TInterfaceStubLog = object
TimeStamp64: Int64;
WasError: boolean;
Method: Pointer;
Params: UTF8String;
CustomResults: UTF8String;
end;
var
a,b: TInterfaceStubLog;
begin
a.Method := Pointer($1);
CopyArray(@b, @a, TypeInfo(TInterfaceStubLog), 1);
if not Assigned(b.Method) then
Halt(1);
===code end===
Mantis conversion info:
- Mantis ID: 31305
- Fixed in version: 3.1.1
- Fixed in revision: 35376 (#c1390b34)