When resizing the stack, fix the pointers properly.

git-svn-id: http://code.remobjects.com/svn/pascalscript@102 5c9d2617-0215-0410-a2ee-e80e04d1c6d8
This commit is contained in:
carlokok 2009-02-11 07:32:23 +00:00
parent 7d88cae7a6
commit 6e0b9d7299

View File

@ -11737,8 +11737,15 @@ begin
OOFS := FLength;
Move(FDataPtr^, p^, OOFS);
OOFS := IPointer(P) - IPointer(FDataPtr);
for i := Count -1 downto 0 do
for i := Count -1 downto 0 do begin
Data[i] := Pointer(IPointer(Data[i]) + OOFS);
if Items[i].FType.FBaseType = btPointer then begin // check if pointer points to moved stack data
if (IPointer(PPSVariantPointer(Data[i]).DataDest) >= IPointer(FDataPtr)) and
(IPointer(PPSVariantPointer(Data[i]).DataDest) < IPointer(FDataPtr)+IPointer(FLength)) then
PPSVariantPointer(Data[i]).DataDest := Pointer(IPointer(PPSVariantPointer(Data[i]).DataDest) + OOFS);
end;
end;
FreeMem(FDataPtr, FCapacity);
end;