Describe the bug
Dataflow is broken for variables used as conditions in conditional operators.
The dataflow is not detected for assignments after the conditional operator.
(A DDG edge seems to be missing in the CPG)
To Reproduce
int main(int argc, char **argv) {
int source = 0;
int source_copy = source;
int sink_1 = source_copy;
int status = source_copy ? 1 : 0;
int sink_2 = source_copy;
}
Import above code and run the queries
cpg.identifier("sink_1").reachableByFlows(cpg.identifier("source")).p //finds flow
cpg.identifier("sink_2").reachableByFlows(cpg.identifier("source")).p //empty
Only the flow to the variable sink_1is detected
Expected behavior
Flow to variable sink_2should be detected as well
Desktop (please complete the following information):