mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 21:11:23 +02:00
Move getting error address / only execute when needed
This commit is contained in:
parent
1d006185ef
commit
3a89160739
@ -1387,8 +1387,6 @@ class procedure TAssert.AssertException(const AMessage: string; const AFormatArg
|
|||||||
var
|
var
|
||||||
Msg,FailMsg : string;
|
Msg,FailMsg : string;
|
||||||
begin
|
begin
|
||||||
If AErrorAddr=Nil then
|
|
||||||
AErrorAddr:=CallerAddr;
|
|
||||||
FailMsg:='';
|
FailMsg:='';
|
||||||
try
|
try
|
||||||
AMethod;
|
AMethod;
|
||||||
@ -1414,6 +1412,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
if aMessage<>'' then
|
if aMessage<>'' then
|
||||||
Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
|
Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
|
||||||
|
If AErrorAddr=Nil then
|
||||||
|
AErrorAddr:=CallerAddr;
|
||||||
Fail(Msg, AErrorAddr);
|
Fail(Msg, AErrorAddr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1486,8 +1486,6 @@ var
|
|||||||
Msg,FailMsg : string;
|
Msg,FailMsg : string;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If AErrorAddr=Nil then
|
|
||||||
AErrorAddr:=CallerAddr;
|
|
||||||
FailMsg:='';
|
FailMsg:='';
|
||||||
try
|
try
|
||||||
AMethod;
|
AMethod;
|
||||||
@ -1513,6 +1511,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
if aMessage<>'' then
|
if aMessage<>'' then
|
||||||
Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
|
Msg:=Format(AMessage, AFormatArgs) + ': '+Msg;
|
||||||
|
If AErrorAddr=Nil then
|
||||||
|
AErrorAddr:=CallerAddr;
|
||||||
Fail(Msg, AErrorAddr);
|
Fail(Msg, AErrorAddr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user