-
Notifications
You must be signed in to change notification settings - Fork 78
Limit table size to TSK_MAX_ID #2337
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
Conversation
89fcd7f to
41294e9
Compare
|
Heh, was good to do this as it exposed a logic error in the overflow check. The calculation overflowed when the added rows were greater than the maximum. |
Codecov Report
@@ Coverage Diff @@
## main #2337 +/- ##
=======================================
Coverage 93.28% 93.28%
=======================================
Files 28 28
Lines 26712 26713 +1
Branches 1222 1222
=======================================
+ Hits 24917 24918 +1
Misses 1762 1762
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
jeromekelleher
left a comment
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.
LGTM, one nit
c/tskit/tables.c
Outdated
| return current_size > (TSK_MAX_SIZE - additional_elements); | ||
| tsk_size_t max_val = TSK_MAX_SIZE; | ||
| return additional_elements > max_val | ||
| || current_size > (TSK_MAX_SIZE - additional_elements); |
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.
Should probably use (max_val - additional_elements) here
|
Needs CHANGELOGs update |
41294e9 to
b81e1c3
Compare
b81e1c3 to
ad011ff
Compare
Docstring did not reflect the changes in tskit-dev#2337.
Docstring did not reflect the changes in tskit-dev#2337.
Docstring did not reflect the changes in #2337.
Fixes #2336