Skip to content

Commit 762710f

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 <johannes.schindelin@gmx.de>
1 parent dc79944 commit 762710f

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

25622562
g = prepare_commit_graph(ctx.r);
25632563
for (struct commit_graph *chain = g; chain; chain = chain->base_graph)
2564+
/* Intentional: codeql[cpp/stack-address-escape] */
25642565
g->topo_levels = &topo_levels;
25652566

25662567
if (flags & COMMIT_GRAPH_WRITE_BLOOM_FILTERS)

0 commit comments

Comments
 (0)