Skip to content

Commit 263da25

Browse files
committed
Use successor location for dominator check.
The assignment is complete only after the statement. This marks self-assignments `x = x + 1` as non-sSA.
1 parent d29dc05 commit 263da25

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/ssa.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor {
162162
Set1::Empty | Set1::Many => false,
163163
Set1::One(LocationExtended::Arg) => true,
164164
Set1::One(LocationExtended::Plain(assign)) => {
165-
assign.dominates(loc, &self.dominators)
165+
assign.successor_within_block().dominates(loc, &self.dominators)
166166
}
167167
};
168168
// We are visiting a use that is not dominated by an assignment.

0 commit comments

Comments
 (0)