Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMerge pull request #22 from mrc-ide/mrc-1281 #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 16 16
Lines 1829 1787 -42
=====================================
- Hits 1829 1787 -42
Continue to review full report at Codecov.
|
|
One purely narrative comment by the negative idx section, and one suggestiong for a link to the perhaps a link to the amazing reside blog when it's published. I'll approve here, but leave you to merge when ready! |
| ## dde 1.0.1 | ||
|
|
||
| * Several memory errors fixed [#22](https://github.com/mrc-ide/dde/pull/22) | ||
|
|
weshinsley
Jan 14, 2020
Contributor
Perhaps a link to the reside blog about this.
Perhaps a link to the reside blog about this.
richfitz
Jan 14, 2020
Author
Member
I'll retrospectively add it to avoid issues with the CRAN link checker
I'll retrospectively add it to avoid issues with the CRAN link checker
| idx0 = min_size((t - t0) / (t1 - t0) / (n - 1), n - 1); | ||
| if ((t0 - t) * (t1 - t) < 0) { | ||
| idx0 = (t - t0) / (t1 - t0) / (n - 1); | ||
| } |
weshinsley
Jan 14, 2020
Contributor
So as we discussed: the values of t0, t1 and t (11, 12, 0.02) that caused the crash are perfectly reasonable; this part of the code should accept them gracefully, and then the code following this uses idx as a start point for searching the buffer.
Hence, zero is the best answer for idx to have after this bit of code, in the cases where it would previously have been negative.
So as we discussed: the values of t0, t1 and t (11, 12, 0.02) that caused the crash are perfectly reasonable; this part of the code should accept them gracefully, and then the code following this uses idx as a start point for searching the buffer.
Hence, zero is the best answer for idx to have after this bit of code, in the cases where it would previously have been negative.
As requested by CRAN on 1 January. Three fixes here - see reside-89 as reside-ic/reside-ic.github.io#34 for details.