Skip to content

Fix overflow for empty ranges #226

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

Merged
merged 4 commits into from
Mar 14, 2021
Merged

Fix overflow for empty ranges #226

merged 4 commits into from
Mar 14, 2021

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Mar 13, 2021

Fixes #225 partially (overflow is not allowed in the OffsetArray constructor for now).

Now

julia> OffsetArray(1:0, typemax(Int))
ERROR: OverflowError: offset should be <= 9223372036854775806 corresponding to the axis Base.OneTo(0), received an offset 9223372036854775807

@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #226 (77988ea) into master (ac9821e) will increase coverage by 0.70%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #226      +/-   ##
==========================================
+ Coverage   98.33%   99.04%   +0.70%     
==========================================
  Files           5        5              
  Lines         301      314      +13     
==========================================
+ Hits          296      311      +15     
+ Misses          5        3       -2     
Impacted Files Coverage Δ
src/OffsetArrays.jl 98.59% <100.00%> (+0.59%) ⬆️
src/precompile.jl 100.00% <0.00%> (+7.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac9821e...77988ea. Read the comment docs.

Copy link
Member

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jishnub for your consistent improvement to this package, you really are bug hunters!

@jishnub jishnub merged commit b33bc00 into JuliaArrays:master Mar 14, 2021
@jishnub jishnub deleted the overflow branch March 14, 2021 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integer overflow in IdOffsetRange
2 participants