Skip to content
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

Avoid integer overflow when constructing arrays #26

Merged
merged 6 commits into from
Apr 23, 2024
Merged

Conversation

giordano
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.57%. Comparing base (02f5218) to head (d0bde93).

Files Patch % Lines
src/FixedSizeArrays.jl 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main      #26      +/-   ##
===========================================
- Coverage   100.00%   98.57%   -1.43%     
===========================================
  Files            1        1              
  Lines           58       70      +12     
===========================================
+ Hits            58       69      +11     
- Misses           0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

checked_dims_impl(m, r)::Int
end

checked_dims(::Tuple{}) = 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This method doesn't seem to be actually used? Or are there constructors I'm missing that'd call it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This should call it, I'll add a test:

julia> using FixedSizeArrays

julia> FixedSizeArray{Int,0}(undef, ())
0-dimensional FixedSizeArray{Int64, 0}:
0

@nsajko
Copy link
Collaborator

nsajko commented Apr 23, 2024

Seems to be a Julia code coverage bug. I get the same result when I run ] test --coverage FixedSizeArrays locally.

The method get's explicitly called here, but it's not marked as covered:

d0bde93#diff-3b9314a6f9f2d7eec1d0ef69fa76cfabafdbe6d0df923768f9ec32f27a249c63R26

@giordano giordano merged commit 958ab85 into main Apr 23, 2024
6 of 8 checks passed
@giordano giordano deleted the mg/check-size branch April 23, 2024 10:35
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.

3 participants