mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 06:00:29 +02:00
+ support for simplifying empty try-except statements
o required for the JVM target, as exception tables with start=end are invalid there git-svn-id: trunk@27742 -
This commit is contained in:
parent
5fa09fa2f4
commit
ea0b9efd20
@ -182,6 +182,7 @@ interface
|
||||
constructor create(l,r,_t1 : tnode);virtual;reintroduce;
|
||||
function pass_typecheck:tnode;override;
|
||||
function pass_1 : tnode;override;
|
||||
function simplify(forinline: boolean): tnode; override;
|
||||
end;
|
||||
ttryexceptnodeclass = class of ttryexceptnode;
|
||||
|
||||
@ -2071,6 +2072,15 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function ttryexceptnode.simplify(forinline: boolean): tnode;
|
||||
begin
|
||||
result:=nil;
|
||||
{ empty try -> can never raise exception -> do nothing }
|
||||
if has_no_code(left) then
|
||||
result:=cnothingnode.create;
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
TTRYFINALLYNODE
|
||||
*****************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user