github / github/codeql

[cpp] Check whether path between function A and function B exists

Open
#19,830 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

Hi! I'm trying to write a query that checks whether function A can call (directly or transitively) function B. I've implemented it with recursive predicate that uses `Function.calls`. It works, but is slow. I suspect DataFlow API can be handy but couldn't produce working query yet. I'm dealing with fairly simple cpp code that doesn't use virtual functions, doesn't use pointer arithmetic, so DataFlow might be a bit too excessive for my task. I wonder what is the most efficient way to solve this problem. Thanks!

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by examining the recursive predicate using `Function.calls` and the available DataFlow API entry points; done means identifying and documenting an efficient approach for checking direct or transitive calls in the stated non-virtual C++ case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.