sway icon indicating copy to clipboard operation
sway copied to clipboard

Properly support divergence in DCA

Open ironcev opened this issue 1 year ago • 0 comments

Currently DCA automatically connects the return node to all of its containing nodes making all of them accessible and thus not-dead. This removes dead-code warnings in cases of divergence as shown in the example below. The variable a is never used because of the nested return but the warning is not generated.

script;

fn main() -> [u64;3] {
    let a = 123u64;
    return [0u64, return [1, 2, 3], a];
}

ironcev avatar Feb 07 '24 09:02 ironcev