mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 08:39:27 +01:00
Try to avoid expectloc not set after first pass error for call node
git-svn-id: trunk@40309 -
This commit is contained in:
parent
122fd55564
commit
cacd8f28eb
@ -1903,18 +1903,27 @@ implementation
|
|||||||
var
|
var
|
||||||
lastinitstatement : tstatementnode;
|
lastinitstatement : tstatementnode;
|
||||||
begin
|
begin
|
||||||
|
if not assigned(n) then
|
||||||
|
exit;
|
||||||
if not assigned(callinitblock) then
|
if not assigned(callinitblock) then
|
||||||
callinitblock:=internalstatements(lastinitstatement)
|
begin
|
||||||
else
|
callinitblock:=internalstatements(lastinitstatement);
|
||||||
lastinitstatement:=laststatement(callinitblock);
|
lastinitstatement.left.free;
|
||||||
|
lastinitstatement.left:=n;
|
||||||
|
firstpass(tnode(callinitblock));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
lastinitstatement:=laststatement(callinitblock);
|
||||||
{ all these nodes must be immediately typechecked, because this routine }
|
{ all these nodes must be immediately typechecked, because this routine }
|
||||||
{ can be called from pass_1 (i.e., after typecheck has already run) and }
|
{ can be called from pass_1 (i.e., after typecheck has already run) and }
|
||||||
{ moreover, the entire blocks themselves are also only typechecked in }
|
{ moreover, the entire blocks themselves are also only typechecked in }
|
||||||
{ pass_1, while the the typeinfo is already required after the }
|
{ pass_1, while the the typeinfo is already required after the }
|
||||||
{ typecheck pass for simplify purposes (not yet perfect, because the }
|
{ typecheck pass for simplify purposes (not yet perfect, because the }
|
||||||
{ statementnodes themselves are not typechecked this way) }
|
{ statementnodes themselves are not typechecked this way) }
|
||||||
firstpass(n);
|
|
||||||
addstatement(lastinitstatement,n);
|
addstatement(lastinitstatement,n);
|
||||||
|
firstpass(tnode(lastinitstatement));
|
||||||
|
{ Update expectloc for callinitblock }
|
||||||
|
callinitblock.expectloc:=lastinitstatement.expectloc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1922,13 +1931,22 @@ implementation
|
|||||||
var
|
var
|
||||||
lastdonestatement : tstatementnode;
|
lastdonestatement : tstatementnode;
|
||||||
begin
|
begin
|
||||||
|
if not assigned(n) then
|
||||||
|
exit;
|
||||||
if not assigned(callcleanupblock) then
|
if not assigned(callcleanupblock) then
|
||||||
callcleanupblock:=internalstatements(lastdonestatement)
|
begin
|
||||||
else
|
callcleanupblock:=internalstatements(lastdonestatement);
|
||||||
lastdonestatement:=laststatement(callcleanupblock);
|
lastdonestatement.left.free;
|
||||||
|
lastdonestatement.left:=n;
|
||||||
|
firstpass(tnode(callcleanupblock));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
lastdonestatement:=laststatement(callcleanupblock);
|
||||||
{ see comments in add_init_statement }
|
{ see comments in add_init_statement }
|
||||||
firstpass(n);
|
|
||||||
addstatement(lastdonestatement,n);
|
addstatement(lastdonestatement,n);
|
||||||
|
firstpass(tnode(lastdonestatement));
|
||||||
|
{ Update expectloc for callcleanupblock }
|
||||||
|
callcleanupblock.expectloc:=lastdonestatement.expectloc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user