fix super_visit_with
for Terminator
This commit is contained in:
parent
a601302ff0
commit
103f7a499b
1 changed files with 14 additions and 17 deletions
|
@ -109,24 +109,21 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
|
||||||
args.visit_with(visitor)
|
args.visit_with(visitor)
|
||||||
}
|
}
|
||||||
Assert { ref cond, ref msg, .. } => {
|
Assert { ref cond, ref msg, .. } => {
|
||||||
if cond.visit_with(visitor).is_break() {
|
cond.visit_with(visitor)?;
|
||||||
use AssertKind::*;
|
use AssertKind::*;
|
||||||
match msg {
|
match msg {
|
||||||
BoundsCheck { ref len, ref index } => {
|
BoundsCheck { ref len, ref index } => {
|
||||||
len.visit_with(visitor)?;
|
len.visit_with(visitor)?;
|
||||||
index.visit_with(visitor)
|
index.visit_with(visitor)
|
||||||
}
|
|
||||||
Overflow(_, l, r) => {
|
|
||||||
l.visit_with(visitor)?;
|
|
||||||
r.visit_with(visitor)
|
|
||||||
}
|
|
||||||
OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => {
|
|
||||||
op.visit_with(visitor)
|
|
||||||
}
|
|
||||||
ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE,
|
|
||||||
}
|
}
|
||||||
} else {
|
Overflow(_, l, r) => {
|
||||||
ControlFlow::CONTINUE
|
l.visit_with(visitor)?;
|
||||||
|
r.visit_with(visitor)
|
||||||
|
}
|
||||||
|
OverflowNeg(op) | DivisionByZero(op) | RemainderByZero(op) => {
|
||||||
|
op.visit_with(visitor)
|
||||||
|
}
|
||||||
|
ResumedAfterReturn(_) | ResumedAfterPanic(_) => ControlFlow::CONTINUE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InlineAsm { ref operands, .. } => operands.visit_with(visitor),
|
InlineAsm { ref operands, .. } => operands.visit_with(visitor),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue