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

Fix a signed/unsigned comparison warning #77230

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

cshung
Copy link
Member

@cshung cshung commented Oct 19, 2022

This bug was found when I tried to enable WRITE_BARRIER_CHECK under NativeAOT in an attempt to diagnose #76801.

On line 242, we are comparing slotCount and the difference between the two pointers. The difference could be a signed number, therefore the compiler flagged a warning and broke the build.

Doing a cast fixed that.

Together with #77011, and a hack in gcrhenv.cpp to turn on HeapVerify to 2, I am able to turn on the write barrier shadow check and found no violation.

@cshung cshung merged commit 9aaa21d into dotnet:main Oct 20, 2022
@cshung cshung deleted the public/fix-signed-comparsion branch October 20, 2022 18:57
@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants