Skip to content

ddg edges reference endpoints that are not body nodes of their own callable #228

Description

@rahlk

Problem

Some ddg edges name an endpoint key that does not exist in the callable's own body{} map. On daytrader8 at -a 4, 87 of 5,434 ddg edges dangle this way, across 38 distinct keys.

Every one of them shares a shape:

  • the key is always <line>:0 — column zero, which no real body-node key uses
  • every affected edge carries prov: ["points-to"]
  • cfg (6,984 edges) and cdg (4,416) have no such endpoint, and neither direction of ddg dangles for any other provenance

So it looks specific to the points-to pass minting a key that the body map never received, rather than a general keying problem.

Consequence

The Neo4j emitter materialises body nodes from body{}, so an edge whose endpoint was never a body node cannot be written: the graph holds 5,347 where the JSON claims 5,434. That is the only place a consumer reading both artefacts sees them disagree — everything else round-trips exactly.

Found while verifying that an SDK's two backends answer identically. Rather than tolerate a fuzzy count, the test now asserts the difference is exactly the set of dangling edges, so a change in this behaviour surfaces immediately.

Repro

java -jar codeanalyzer-3.0.1.jar -i <daytrader8> -a 4 -o out

then for each callable, check every ddg edge's src and dst against the keys of that callable's own body{}. The 87 misses are all <line>:0.

Not visible on a small pruned project — a fixture of four files has none — so a scale corpus is needed to see it.

Definition of done

  • Every ddg endpoint is a key of the callable's own body{}, or the vertex it names is emitted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions