fuzzbug fix
This commit is contained in:
parent
fd969d9089
commit
88251ad7fb
|
@ -73,7 +73,7 @@ impl Schedule {
|
||||||
|
|
||||||
// Prepare the "waiting on value", "remaining inputs", and
|
// Prepare the "waiting on value", "remaining inputs", and
|
||||||
// "ready" vectors.
|
// "ready" vectors.
|
||||||
'skipvalue: for (value, value_def) in f.values() {
|
for (value, value_def) in f.values() {
|
||||||
if uses.use_count[value.index()] == 0 {
|
if uses.use_count[value.index()] == 0 {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,10 @@ impl Schedule {
|
||||||
}
|
}
|
||||||
match value_def {
|
match value_def {
|
||||||
&ValueDef::Operator(op, ref operands) => {
|
&ValueDef::Operator(op, ref operands) => {
|
||||||
|
if operands.iter().any(|&value| value == Value::undef()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if operands.len() == 0 {
|
if operands.len() == 0 {
|
||||||
if !op_rematerialize(&op) {
|
if !op_rematerialize(&op) {
|
||||||
log::trace!("immediately ready: v{}", value.index());
|
log::trace!("immediately ready: v{}", value.index());
|
||||||
|
@ -90,9 +94,6 @@ impl Schedule {
|
||||||
} else {
|
} else {
|
||||||
let mut remaining = 0;
|
let mut remaining = 0;
|
||||||
for &input in operands {
|
for &input in operands {
|
||||||
if input == Value::undef() {
|
|
||||||
continue 'skipvalue;
|
|
||||||
}
|
|
||||||
let input = f.resolve_alias(input);
|
let input = f.resolve_alias(input);
|
||||||
|
|
||||||
match &f.values[input.index()] {
|
match &f.values[input.index()] {
|
||||||
|
@ -222,14 +223,10 @@ impl<'a> SchedulerContext<'a> {
|
||||||
log::trace!("wake_dependents: v{}", v.index());
|
log::trace!("wake_dependents: v{}", v.index());
|
||||||
let dependents = self.waiting_on_value.remove(&v).unwrap_or_default();
|
let dependents = self.waiting_on_value.remove(&v).unwrap_or_default();
|
||||||
for dependent in dependents {
|
for dependent in dependents {
|
||||||
|
log::trace!(" -> v{} wakes dependent v{}", v.index(), dependent.index(),);
|
||||||
let remaining = self.remaining_inputs.get_mut(&dependent).unwrap();
|
let remaining = self.remaining_inputs.get_mut(&dependent).unwrap();
|
||||||
*remaining -= 1;
|
*remaining -= 1;
|
||||||
log::trace!(
|
log::trace!(" -> remaining now {}", *remaining);
|
||||||
" -> v{} wakes dependent v{}; remaining now {}",
|
|
||||||
v.index(),
|
|
||||||
dependent.index(),
|
|
||||||
*remaining
|
|
||||||
);
|
|
||||||
if *remaining == 0 {
|
if *remaining == 0 {
|
||||||
self.remaining_inputs.remove(&dependent);
|
self.remaining_inputs.remove(&dependent);
|
||||||
self.ready.push(dependent);
|
self.ready.push(dependent);
|
||||||
|
|
Loading…
Reference in a new issue