Skip to content

[Bug][C] Missing calls in ternary conditionals #5583

@mal-tee

Description

@mal-tee

Describe the bug
Method calls in ternary conditional expressions are not generated correctly.

To Reproduce

#include <stdio.h>
#include <stdbool.h>

void open_file_1() {
    printf("1");
}

void open_file_2() {
    printf("2");
}

int main (int argc, char **argv) {
    bool cond = true;
    ((cond ? open_file_1 : open_file_2) ());
}
// in joern, after importCode():
cpg.call("open_file_1").l // empty
cpg.call("open_file_2").l // empty

Expected behavior
The calls should be found.

Desktop (please complete the following information):
Latest joern via docker/nightly (4.0.388)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions