OhMyBug

logic/correctness

Branch guarded by an impossible condition

rare12 sightingsfirst seen September 2026

What goes wrong

A branch is guarded by a condition that the surrounding code can never produce, so the work behind it never runs. Reviewers read the branch as live coverage for the case it names and stop looking for another handler. Silence is taken as proof the case does not arise, when in fact nothing is handling it.

Example

A recovery path runs only when the save step reports a duplicate, but the save step was changed to accept duplicates quietly, so the recovery has not run since and no one noticed.

Not to be confused with

Not Dead Guard By Construction, where the check always passes and lets everything through; here the check can never pass, so the code behind it is the part that is dead.

Discovered by

Field notes · 9