Fix missing Raise before Exception.Create. Issue ##40860. Patch by n7800.

(cherry picked from commit 1f7accb9e2)
This commit is contained in:
Bart 2024-04-17 13:29:00 +02:00 committed by Maxim Ganetsky
parent 452adce230
commit f6e8cb7775
3 changed files with 5 additions and 5 deletions

View File

@ -124,7 +124,7 @@ begin
// delete space behind // delete space behind
while Tool.Src[ToPos] in [' ',#9] do inc(ToPos); while Tool.Src[ToPos] in [' ',#9] do inc(ToPos);
if not Changer.Replace(gtNone,gtNone,FromPos,ToPos,'') then if not Changer.Replace(gtNone,gtNone,FromPos,ToPos,'') then
Exception.Create('source not writable'); raise Exception.Create('source not writable');
end; end;
begin begin
@ -225,7 +225,7 @@ begin
EnterInsertPos,EnterInsertPos, EnterInsertPos,EnterInsertPos,
Beauty.GetIndentStr(Beauty.GetLineIndent(Tool.Src,Node.StartPos)+Indent)+EnterCall+'('''+Signature+''');') Beauty.GetIndentStr(Beauty.GetLineIndent(Tool.Src,Node.StartPos)+Indent)+EnterCall+'('''+Signature+''');')
then then
Exception.Create('source not writable'); raise Exception.Create('source not writable');
end; end;
if (not HasExitCall) then begin if (not HasExitCall) then begin
// add Exit call // add Exit call
@ -233,7 +233,7 @@ begin
ExitInsertPos,ExitInsertPos, ExitInsertPos,ExitInsertPos,
Beauty.GetIndentStr(Beauty.GetLineIndent(Tool.Src,Node.StartPos)+Indent)+ExitCall+'('''+Signature+''');') Beauty.GetIndentStr(Beauty.GetLineIndent(Tool.Src,Node.StartPos)+Indent)+ExitCall+'('''+Signature+''');')
then then
Exception.Create('source not writable'); raise Exception.Create('source not writable');
end; end;
end; end;
end; end;

View File

@ -4835,7 +4835,7 @@ begin
if PointsEnd = nil then if PointsEnd = nil then
begin begin
if Len <> 0 then if Len <> 0 then
Exception.Create('[TPath.AppendSegment] Assertion failed Len <> 0 with PointsEnd = nil'); raise Exception.Create('[TPath.AppendSegment] Assertion failed Len <> 0 with PointsEnd = nil');
Points := ASegment; Points := ASegment;
PointsEnd := ASegment; PointsEnd := ASegment;

View File

@ -526,7 +526,7 @@ begin
debuglnEnter(['> TRefCountedJitReference.Destroy ',dbgs(self),' ' ]); try debuglnEnter(['> TRefCountedJitReference.Destroy ',dbgs(self),' ' ]); try
{$ENDIF} {$ENDIF}
if FRefCount > 0 then raise if FRefCount > 0 then raise
exception.Create('destroy while referrenced'); raise exception.Create('destroy while referrenced');
DoRefCountZero; DoRefCountZero;
inherited Destroy; inherited Destroy;