after a Ref, only acquire the Deref'd destination
This commit is contained in:
parent
b6816b2b56
commit
04f962adc3
1 changed files with 4 additions and 0 deletions
|
|
@ -184,6 +184,10 @@ impl MirPass for AddValidation {
|
|||
_ => continue,
|
||||
};
|
||||
// So this is a ref, and we got all the data we wanted.
|
||||
// Do an acquire of the result -- but only what it points to, so add a Deref
|
||||
// projection.
|
||||
let dest_lval = Projection { base: dest_lval, elem: ProjectionElem::Deref };
|
||||
let dest_lval = Lvalue::Projection(Box::new(dest_lval));
|
||||
let acquire_stmt = Statement {
|
||||
source_info: block_data.statements[i].source_info,
|
||||
kind: StatementKind::Validate(ValidationOp::Acquire,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue