Skip to content

Commit cb7b966

Browse files
committed
Fix: getNumResult() was wrong in some cases
It was the number of result declarations, which is different from the number of results when one result declaration declares more than one variable, as in `x, y int`.
1 parent 8cc46c7 commit cb7b966

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

go/ql/lib/semmle/go/Expr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ class FuncTypeExpr extends @functypeexpr, TypeExpr, ScopeNode, FieldParent {
10641064
ResultVariableDecl getAResultDecl() { result = this.getResultDecl(_) }
10651065

10661066
/** Gets the number of results of this function type. */
1067-
int getNumResult() { result = count(this.getAResultDecl()) }
1067+
int getNumResult() { result = count(this.getAResultDecl().getANameExpr()) }
10681068

10691069
/**
10701070
* Gets the result of this function type, if there is only one.

0 commit comments

Comments
 (0)