Skip to content

[Bug] ddgIn has false dependence problem #5693

@wsliture

Description

@wsliture

Describe the bug
given the code

void print(char*);

int main() {
    int a = 1;
    int b = 2;
    if (a && b) {
        print("x")
    }
}

Please keep the conversation English! Make it easy for us and share your input code or a minified example.

To Reproduce
run the query :cpg.identifier("a").lineNumber(7).ddgIn.l
get the following result :

val res2: List[io.shiftleft.codepropertygraph.generated.nodes.CfgNode] = List(
  Identifier(
    argumentIndex = 1,
    argumentName = None,
    code = "a",
    columnNumber = Some(value = 9),
    dynamicTypeHintFullName = IndexedSeq(),
    lineNumber = Some(value = 5),
    name = "a",
    order = 1,
    possibleTypes = IndexedSeq(),
    typeFullName = "int"
  ),
  Identifier(
    argumentIndex = 2,
    argumentName = None,
    code = "b",
    columnNumber = Some(value = 14),
    dynamicTypeHintFullName = IndexedSeq(),
    lineNumber = Some(value = 7),
    name = "b",
    order = 2,
    possibleTypes = IndexedSeq(),
    typeFullName = "int"
  )
)

I don't know why there is dependence between a and b

Expected behavior
no the dependence b

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS
  • Joern Version: leatest version
  • Java version: java 24

Additional context
Add any other context about the problem here.

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