mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 06:26:27 +02:00
* small typecheckpass wrapper for recursion
git-svn-id: trunk@8434 -
This commit is contained in:
parent
ddc0ac9a43
commit
1d387c935d
@ -32,6 +32,9 @@ interface
|
|||||||
|
|
||||||
type
|
type
|
||||||
taddnode = class(tbinopnode)
|
taddnode = class(tbinopnode)
|
||||||
|
private
|
||||||
|
function pass_typecheck_internal:tnode;
|
||||||
|
public
|
||||||
resultrealdef : tdef;
|
resultrealdef : tdef;
|
||||||
constructor create(tt : tnodetype;l,r : tnode);override;
|
constructor create(tt : tnodetype;l,r : tnode);override;
|
||||||
function pass_1 : tnode;override;
|
function pass_1 : tnode;override;
|
||||||
@ -721,15 +724,25 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
function taddnode.pass_typecheck:tnode;
|
function taddnode.pass_typecheck:tnode;
|
||||||
|
begin
|
||||||
|
{ This function is small to keep the stack small for recursive of
|
||||||
|
large + operations }
|
||||||
|
typecheckpass(left);
|
||||||
|
typecheckpass(right);
|
||||||
|
result:=pass_typecheck_internal;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function taddnode.pass_typecheck_internal:tnode;
|
||||||
var
|
var
|
||||||
hp : tnode;
|
hp : tnode;
|
||||||
lt,rt : tnodetype;
|
|
||||||
rd,ld : tdef;
|
rd,ld : tdef;
|
||||||
ot : tnodetype;
|
|
||||||
hsym : tfieldvarsym;
|
hsym : tfieldvarsym;
|
||||||
i : longint;
|
i : longint;
|
||||||
strtype : tstringtype;
|
strtype : tstringtype;
|
||||||
b : boolean;
|
b : boolean;
|
||||||
|
lt,rt : tnodetype;
|
||||||
|
ot : tnodetype;
|
||||||
{$ifdef state_tracking}
|
{$ifdef state_tracking}
|
||||||
factval : Tnode;
|
factval : Tnode;
|
||||||
change : boolean;
|
change : boolean;
|
||||||
@ -737,9 +750,6 @@ implementation
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
{ first do the two subtrees }
|
|
||||||
typecheckpass(left);
|
|
||||||
typecheckpass(right);
|
|
||||||
{ both left and right need to be valid }
|
{ both left and right need to be valid }
|
||||||
set_varstate(left,vs_read,[vsf_must_be_valid]);
|
set_varstate(left,vs_read,[vsf_must_be_valid]);
|
||||||
set_varstate(right,vs_read,[vsf_must_be_valid]);
|
set_varstate(right,vs_read,[vsf_must_be_valid]);
|
||||||
|
Loading…
Reference in New Issue
Block a user