-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix: Fix voltage vector size in threshold_watcher contstructor #1820
Bug fix: Fix voltage vector size in threshold_watcher contstructor #1820
Conversation
bors try |
tryTimed out. |
bors try |
tryBuild succeeded: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A suggestion, rest looks fine.
{ | ||
arb_assert(n_cv_==thresholds.size()); | ||
reset(); | ||
// reset() needs to be called before this is ready for use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
tryBuild succeeded: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fix the following 2 issues:
threshold_watcher::v_prev_
is being constructed from a pointer toshared_state::voltage
and a size argument not equal to the size of that vector. This isn't usually a problem because the size used is typically less than the maximum size of thevoltage
vector. However, it can cause problems if that assumption fails.v_prev_
is copied over fromshared_state::voltage
before that vector is initialized toinit_voltage
inshared_state::reset
. This can cause incorrect results at the very first application ofthreshold_watcher::test
.