[fpc-pascal] dynamic array contents and system.move

David Emerson dle3ab at angelbase.com
Sat Apr 24 20:38:29 CEST 2010


I have a class that has a field,

f_data : array of byte;  // a dynamic array

Within a method of this class (which takes as a parameter "src", another 
instance of the class) I have the following code:

move (src.f_data, self.f_data, length(self.f_data) * sizeof(byte));

It appears that this move operation is going far beyond the length of 
self.f_data, and overwriting other data.

Is there something obviously wrong here?

thanks,
David




More information about the fpc-pascal mailing list