FpDebug: Handle CIEs and FDEs without instructions properly

This commit is contained in:
Joost van der Sluis 2022-07-02 00:30:06 +02:00
parent 9f9fdf6a9d
commit 4ed7f56bb4
2 changed files with 10 additions and 2 deletions

View File

@ -261,6 +261,11 @@ var
uparam1, uparam2: QWord; uparam1, uparam2: QWord;
sparam: Int64; sparam: Int64;
begin begin
if Length(Instructions) = 0 then
begin
Result := True;
Exit;
end;
Result := False; Result := False;
if Instructions=nil then exit; if Instructions=nil then exit;
p := @Instructions[0]; p := @Instructions[0];

View File

@ -3935,8 +3935,11 @@ var
// initial instructions') // initial instructions')
Dec(SizeLeft, p-Augmentation); Dec(SizeLeft, p-Augmentation);
SetLength(Instructions, SizeLeft); SetLength(Instructions, SizeLeft);
Move(p^, Instructions[0], SizeLeft); if SizeLeft > 0 then
Result.InitialInstructions := Instructions; begin
Move(p^, Instructions[0], SizeLeft);
Result.InitialInstructions := Instructions;
end;
end; end;
function LoadFDE(CFI: TDwarfCallFrameInformation; CIEPointer: QWord; InitialLocationAddr: pointer; SizeLeft: QWord): TDwarfFDE; function LoadFDE(CFI: TDwarfCallFrameInformation; CIEPointer: QWord; InitialLocationAddr: pointer; SizeLeft: QWord): TDwarfFDE;