Skip to content

Commit c25505f

Browse files
committed
commit-graph: suppress warning about using a stale stack addresses
The code is a bit too hard to reason about for CodeQL to figure out whether the `fill_commit_graph_info()` function is at all called after `write_commit_graph()` returns (and hence whether `topo_levels` goes out of context before it is used again). The Git project insists that this is correct (and does not want to make the code more obviously correct), so let's silence CodeQL's complaints in this instance. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent aa32ccd commit c25505f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

commit-graph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,7 @@ int write_commit_graph(struct odb_source *source,
25612561
struct commit_graph *g = ctx.r->objects->commit_graph;
25622562

25632563
while (g) {
2564+
/* Intentional: codeql[cpp/stack-address-escape] */
25642565
g->topo_levels = &topo_levels;
25652566
g = g->base_graph;
25662567
}

0 commit comments

Comments
 (0)