Skip to content

Commit

Permalink
fix: StackOverflow caused by Debug recursive call
Browse files Browse the repository at this point in the history
For the `VerifyFailure::ConstraintNotSatisfied` case we want to customly
impl the `Debug` call so that we can print the annotations within the
`VirtualCell`s.

If we hit any other case of `VerifyFailure` we basically send it to
print and be handled by (ideally Display).

The issue is that the call was forwarded to `Debug` impl again which
ended up in an infinite recursive call to the `Debug` method.
See: privacy-scaling-explorations#109 (comment)

This is solved by calling `Display` if we hit a case that is not
`ConstraintNotSatisfied`.
  • Loading branch information
CPerezz committed Jan 10, 2023
1 parent 3b70fe7 commit 22e3504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion halo2_proofs/src/dev/failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl<'a> Debug for VerifyFailure<'a> {

write!(f, "{:#?}", debug)
}
_ => write!(f, "{:#?}", self),
_ => write!(f, "{}", self),
}
}
}
Expand Down

0 comments on commit 22e3504

Please sign in to comment.