Skip to content

Commit

Permalink
SONARERLNG-19 fix nullpointer in tail recursive check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamas Kende committed Feb 26, 2015
1 parent bdd2523 commit ff81da2
Show file tree
Hide file tree
Showing 3 changed files with 2,164 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public void visitNode(AstNode node) {
if (node.getType().equals(ErlangGrammarImpl.functionDeclaration)) {
actualArity = getArity(node.getFirstChild(ErlangGrammarImpl.functionClause));
} else if (node.getType().equals(ErlangGrammarImpl.callExpression)
/**
* Not in a module attribute
*/
&& node.getFirstAncestor(ErlangGrammarImpl.defineAttr) == null
/**
* Recursive call
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ public void test2() {
.next().atLine(12)
.noMore();
}

@Test
public void test_bug() {
IsTailRecursiveCheck check = new IsTailRecursiveCheck();
SourceFile file = TestHelper.scanSingleFile(new File(
"src/test/resources/checks/mod_configure.erl"), check);


}
}
Loading

0 comments on commit ff81da2

Please sign in to comment.