FPDebug: fix dwarf reader. do not scan past end of data

git-svn-id: trunk@43298 -
This commit is contained in:
martin 2013-10-21 09:36:20 +00:00
parent c3cd2af441
commit eb2df97821

View File

@ -3807,7 +3807,7 @@ begin
MaxData := FInfoData + FLength;
Scope := AStartScope;
p := Scope.Entry;
while (p <= MaxData) and (Level >= 0) do
while (p < MaxData) and (Level >= 0) do
begin
p := Scope.Entry;
p2:=p;
@ -3949,7 +3949,9 @@ begin
Scope.Index := ni; // GoNext
end;
if (p > MaxData) then begin
if (p >= MaxData) then begin
if (p > MaxData) then
debugln(FPDBG_DWARF_WARNINGS, ['LocateEntry went past end of memory: ', p-MaxData]);
SetLength(FScopeList.List, FScopeList.HighestKnown + 1);
end;