Skip to content

Handle byte swaps in range overflow analysis - #136632

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
NinoFloris:fix/bswap-range-overflow
Oct 30, 2026
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
NinoFloris:fix/bswap-range-overflow

Conversation

@NinoFloris

Copy link
Copy Markdown
Contributor

Fixes #136615 (comment)

Handling BSWAP means a method like this no longer contains redundant bounds checks:

static int Read(int[] data, int wireIndex)
{
    int index = BinaryPrimitives.ReverseEndianness(wireIndex);
    if (index < 0 || index > data.Length - 2)
        return -1;

    return data[index + 1];
}

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 29, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 29, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@NinoFloris
NinoFloris marked this pull request as ready for review October 29, 2026 15:13
@EgorBo

EgorBo commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Zero diffs, but I've just merged my PR, can you merge main into it so we try again? (I don't want to hit that button myself because it won't allow me to approve the PR then).

@NinoFloris
NinoFloris force-pushed the fix/bswap-range-overflow branch from b5b4a3f to 0b43d6e Compare October 29, 2026 23:37
@NinoFloris

Copy link
Copy Markdown
Contributor Author

@EgorBo all ready now.

@EgorBo
EgorBo merged commit de42bfa into dotnet:main Oct 30, 2026
136 checks passed
@EgorBo

EgorBo commented Oct 30, 2026

Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member reduce-unsafe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants