问题
I am trying to resolve an access violation in a Delphi XE7 application which is occurs in this code, which is part of the Jedi VCL JvMemoryDataset component (current source at Github):
begin
Data^ := Ord(Buffer <> nil);
Inc(Data);
if Buffer <> nil then
Move(Buffer^, Data^, CalcFieldLen(Field.DataType, Field.Size)) <---------- AV here
else
FillChar(Data^, CalcFieldLen(Field.DataType, Field.Size), 0);
end;
The code sporadically causes a read access violation at address 04020111. Is there an obvious problem in this code? (CalcFieldLen might return 0, not sure if this is relevant here).
I have checked the current development version of JVCL and the Move call is the same as in my (older) local version.
It might be related to the issue https://issuetracker.delphi-jedi.org/view.php?id=6276
Related (with debugging suggestions): Sporadic Access Violation after porting from D2006 to XE5, doesn't happen in XP compatibility mode
来源:https://stackoverflow.com/questions/62306617/sporadic-access-violation-in-tjvmemorydata-internalsetfielddata