Repository navigation
Make CodeQL happy for underflow issue - #477
Merged
Merged
Conversation
This is a false positive due to the way the fold expression, is actually empty when rank==0 but just modifying the condition is an easy way to make it happy. Signed-off-by: Christian Trott <crtrott@sandia.gov>
mhoemmen
approved these changes
Sep 30, 2026
mhoemmen
left a comment
Contributor
There was a problem hiding this comment.
Thanks Christian! : - )
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The revised condition can still overflow unsigned arithmetic and produce an incorrect mapping.
Review effort: Lite
Findings: None
What changed in this PR
This pull request updates the right-padded submdspan static-stride condition to avoid CodeQL’s unsigned-underflow warning.
Changes:
- Replaces subtraction-based bounds checks with addition-based checks.
- Documents the condition change.
| File | Description |
|---|---|
include/experimental/__p2630_bits/submdspan_mapping.hpp |
Adjusts right-layout static stride computation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dalg24
pushed a commit
to kokkos/kokkos
that referenced
this pull request
Oct 15, 2026
mdspan PRs included: - fixup project name [#474](kokkos/mdspan#474) - run pre-commit [#475](kokkos/mdspan#475) - strided_slice [#476](kokkos/mdspan#476) - codeql underflow issue [#477](kokkos/mdspan#477) - license fixup [#478](kokkos/mdspan#478) - range-slice [#479](kokkos/mdspan#479) Signed-off-by: Christian Trott <crtrott@sandia.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a false positive due to the way the fold expression, is actually empty when rank==0 but just modifying the condition is an easy way to make it happy.
Was reported as security vulnerability on Kokkos Core.