Skip to main content

merge_branches

Function merge_branches 

Source
fn merge_branches(
    base: State,
    then_state: State,
    else_state: State,
    then_exits: bool,
    else_exits: bool,
) -> State
Expand description

Joins the two arms of an if: a pending write stays covered only if both arms emitted for it, while taint and aliases come from whichever arms can continue past the if. Emits recorded inside either arm are dropped rather than carried past the merge: correlate_pending already resolved them against that arm’s own writes before this runs, and code after the if executes whichever branch ran (or neither), so an emit conditional on one arm must not retroactively satisfy a write reachable only outside it.