mirror of
https://github.com/github/codeql.git
synced 2026-08-05 09:53:29 +02:00
Model `defer`ed calls so the call runs at function exit rather than inline at the `defer` statement, reproducing the previous control-flow semantics: - Add a per-defer "defer-invoke" node for the deferred call. - deferExitStep wires normal-exit predecessors (return nodes and body fall-through) through the active deferred-call invocations in last-in-first-out order, then on to the normal exit target (the result-read epilogue for named results, or the normal exit node). - The chain is reachability-gated using the defer-free successor relation (succIgnoringDeferExit / isInOrderNode), so only deferred calls that were actually registered on a path are run on that path. - overridesCallableBodyExit / overridesCallableEndAbruptCompletion suppress the default body-exit and return routing for functions containing `defer`, so the epilogue is interposed instead.