Skip to content
Snippets Groups Projects
Commit 11229ace authored by Emma Söderberg's avatar Emma Söderberg
Browse files

Adds circular check to internal incremental/param methods.

Methods:
- inc_changeState
- inc_flush_subtree
- inc_throwAway

All these methods may be called on rewrittenNode_value which
may have the value this.
parent 0466a37c
No related branches found
No related tags found
No related merge requests found
...@@ -902,8 +902,13 @@ $endif ...@@ -902,8 +902,13 @@ $endif
$endif $endif
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
private boolean #name.inc_flush_subtree_visited = false;
/** @apilevel internal */ /** @apilevel internal */
protected void #name.inc_flush_subtree($DDGNodeName h) { protected void #name.inc_flush_subtree($DDGNodeName h) {
if (inc_flush_subtree_visited) {
return;
}
inc_flush_subtree_visited = true;
inc_state = inc_GARBAGE; inc_state = inc_GARBAGE;
$FlushNtaSubTrees $FlushNtaSubTrees
$TransferSetsFromAttrTokenHandlers $TransferSetsFromAttrTokenHandlers
...@@ -923,6 +928,7 @@ $if(#isASTNodeDecl) ...@@ -923,6 +928,7 @@ $if(#isASTNodeDecl)
$else $else
super.inc_flush_subtree(h); super.inc_flush_subtree(h);
$endif $endif
inc_flush_subtree_visited = false;
} }
$endif $endif
......
...@@ -156,8 +156,13 @@ $endif ...@@ -156,8 +156,13 @@ $endif
]] ]]
ASTDecl.incChangeStateMethod = [[ ASTDecl.incChangeStateMethod = [[
private boolean #name.inc_changeState_visited = false;
/** @apilevel internal */ /** @apilevel internal */
public void #name.inc_changeState(int newState) { public void #name.inc_changeState(int newState) {
if (inc_changeState_visited) {
return;
}
inc_changeState_visited = true;
$if(#isASTNodeDecl) $if(#isASTNodeDecl)
inc_state = newState; inc_state = newState;
...@@ -214,6 +219,7 @@ $else ...@@ -214,6 +219,7 @@ $else
$endif $endif
$ChangeStateTokens $ChangeStateTokens
$ChangeStateAttributes $ChangeStateAttributes
inc_changeState_visited = false;
} }
]] ]]
...@@ -262,8 +268,13 @@ $endif ...@@ -262,8 +268,13 @@ $endif
]] ]]
ASTDecl.incThrowAwayMethod = [[ ASTDecl.incThrowAwayMethod = [[
private boolean #name.inc_throwAway_visited = false;
/** @apilevel internal */ /** @apilevel internal */
public void #name.inc_throwAway() { public void #name.inc_throwAway() {
if (inc_throwAway_visited) {
return;
}
inc_throwAway_visited = true;
inc_state = inc_GARBAGE; inc_state = inc_GARBAGE;
$if(#isASTNodeDecl) $if(#isASTNodeDecl)
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
...@@ -315,6 +326,7 @@ $else ...@@ -315,6 +326,7 @@ $else
$endif $endif
$ThrowAwayTokens $ThrowAwayTokens
$ThrowAwayAttributes $ThrowAwayAttributes
inc_throwAway_visited = false;
} }
]] ]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment