Skip to content

Commit ce5b035

Browse files
committed
Fix liveness analysis for read-write inline asm operands
1 parent 9d7b113 commit ce5b035

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc/middle/liveness.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1167,13 +1167,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11671167
hir::ExprInlineAsm(ref ia) => {
11681168

11691169
let succ = ia.outputs.iter().rev().fold(succ,
1170-
|succ, &(_, ref expr, _, is_indirect)| {
1170+
|succ, &(_, ref expr, is_rw, is_indirect)| {
11711171
// see comment on lvalues
11721172
// in propagate_through_lvalue_components()
11731173
if is_indirect {
11741174
self.propagate_through_expr(&**expr, succ)
11751175
} else {
1176-
let succ = self.write_lvalue(&**expr, succ, ACC_WRITE);
1176+
let acc = if is_rw { ACC_WRITE|ACC_READ } else { ACC_WRITE };
1177+
let succ = self.write_lvalue(&**expr, succ, acc);
11771178
self.propagate_through_lvalue_components(&**expr, succ)
11781179
}
11791180
}

0 commit comments

Comments
 (0)