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

runtime/mlvalues.h: more careful definition of Tag_val #12703

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

xavierleroy
Copy link
Contributor

The offset - sizeof(value) should be signed, otherwise pointer overflow can (formally) occur.

Fixes: #12528

The offset `- sizeof(value)` should be signed, otherwise pointer overflow
can (formally) occur.

Fixes: ocaml#12528
Copy link
Contributor

@gadmm gadmm left a comment

Choose a reason for hiding this comment

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

I could independently reproduce the fix with godbolt when this was discussed. (An alternative was to expand the definition, e.g. *(v-s).)

@xavierleroy
Copy link
Contributor Author

Appveyor failure is on finaliser_handover.ml , as usual. Ignoring.

@xavierleroy xavierleroy merged commit 6bad032 into ocaml:trunk Oct 30, 2023
8 of 9 checks passed
@xavierleroy xavierleroy deleted the Tag_val-UB branch October 30, 2023 18:13
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.

Possibly undefined behavior in definition of Tag_val
2 participants