mirror of
https://github.com/github/codeql.git
synced 2026-07-06 20:15:37 +02:00
TODO Interim fix:
For now don't allow the neighborhood to go all the way out to the outermostEnclosingFunction, because that causes bugs. After this change, `enclosingFunctionBodyEndpointNeighborhood` doesn't match `enclosingFunctionBody` even when the function is small, which is undesired behavior. `enclosingFunctionBody` includes the arguments to the function whereas `enclosingFunctionBodyEndpointNeighborhood` does not. We should find a way to fix this.
This commit is contained in:
@@ -208,7 +208,7 @@ module NeighborhoodBodies {
|
||||
*/
|
||||
Raw::AstNode getNeighborhoodAstNode(Raw::AstNode node, DescendantsThreshold maxNumDescendants) {
|
||||
if
|
||||
node = getOutermostEnclosingFunction(node) or
|
||||
node.getParentNode() = getOutermostEnclosingFunction(node) or
|
||||
getNumDescendents(node.getParentNode()) > maxNumDescendants.getMaxNumDescendants()
|
||||
then result = node
|
||||
else result = getNeighborhoodAstNode(node.getParentNode(), maxNumDescendants)
|
||||
|
||||
Reference in New Issue
Block a user