* also process all subnodes of try-except and try-finally in

foreachnode(static) (fixes first example of mantis #9076)

git-svn-id: trunk@7671 -
This commit is contained in:
Jonas Maebe 2007-06-15 17:36:09 +00:00
parent ba95cc22ee
commit 62b3b307e0
4 changed files with 43 additions and 2 deletions

2
.gitattributes vendored
View File

@ -8295,6 +8295,8 @@ tests/webtbs/tw8950.pp svneol=native#text/plain
tests/webtbs/tw8975.pp svneol=native#text/plain
tests/webtbs/tw8975a.pp svneol=native#text/plain
tests/webtbs/tw9054.pp svneol=native#text/plain
tests/webtbs/tw9076.pp svneol=native#text/plain
tests/webtbs/tw9076a.pp svneol=native#text/plain
tests/webtbs/tw9085.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -125,7 +125,7 @@ implementation
result := foreachnode(tcallnode(n).methodpointer,f,arg) or result;
result := foreachnode(tcallnode(n).methodpointerdone,f,arg) or result;
end;
ifn, whilerepeatn, forn:
ifn, whilerepeatn, forn, tryexceptn, tryfinallyn:
begin
{ not in one statement, won't work because of b- }
result := foreachnode(tloopnode(n).t1,f,arg) or result;
@ -173,7 +173,7 @@ implementation
result := foreachnodestatic(procmethod,tcallnode(n).methodpointer,f,arg) or result;
result := foreachnodestatic(procmethod,tcallnode(n).methodpointerdone,f,arg) or result;
end;
ifn, whilerepeatn, forn:
ifn, whilerepeatn, forn, tryexceptn, tryfinallyn:
begin
{ not in one statement, won't work because of b- }
result := foreachnodestatic(procmethod,tloopnode(n).t1,f,arg) or result;

29
tests/webtbs/tw9076.pp Normal file
View File

@ -0,0 +1,29 @@
{ %norun }
unit tw9076;
{$mode objfpc}
interface
type
pfdset = pointer;
function __Select(N: Longint; ReadFds: PFDSet; WriteFds: PFDSet;
ExceptFds: PFDSet): Longint; inline;
implementation
function __Select(N: Longint; ReadFds: PFDSet; WriteFds: PFDSet;
ExceptFds: PFDSet): Longint;
begin
try
result := 2
except
Result := -1
end
end;
end.

10
tests/webtbs/tw9076a.pp Normal file
View File

@ -0,0 +1,10 @@
{ %norun }
program chatserver;
uses tw9076;
begin
__Select(0, nil, nil, nil)
end.