-
Notifications
You must be signed in to change notification settings - Fork 97
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
Audit for transmute
#1104
Audit for transmute
#1104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a bit more test coverage to transmute? Things like transmute pointers, structures, slices? Thanks
let arg_align_check = self.codegen_assert( | ||
arg_align, | ||
PropertyClass::DefaultAssertion, | ||
"transmute: argument type is properly aligned", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The failure message usually states the failure. Maybe change it to something like: transmute check: argument type isn't properly aligned
or transmute check: argument type must be properly aligned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks Adrian
I have restored the original implementation and added 4 tests to check correct transmutations between
This is in addition to another one that is present in the |
Description of changes:
Updates the
transmute
intrinsic with alignment checks for both the argument type and the result type. However, this does not seem to be working as I expected, and a large number of failures are being triggered on our regression.In fact, the test added in this PR is failing with "transmute: result type is properly aligned" instead of "transmute: argument type is properly aligned". I don't know if I'm missing something.
Resolved issues:
Part of #727
Call-outs:
Testing:
How is this change tested? Adds one test.
Is this a refactor change? No.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.