Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Apr 24, 2023

Helps avoid UB or inconsistencies between Julia and C definitions.

Helps avoid UB or inconsistencies between Julia and C definitions.
@gbaraldi
Copy link
Member

Why are we adding the padding in the taggedvalue_bits if we don't set them?(I know setting them would be incorrect) but I thought that union would be fine here.

@vtjnash
Copy link
Member Author

vtjnash commented Apr 24, 2023

Adding padding forces C to consider them preserved after changing the other bits. It doesn't seem like the compiler usually bothers to corrupt them, but the bits were technically undefined after changing them because they are in the union.

@gbaraldi
Copy link
Member

Ok, then LGTM

@vtjnash vtjnash merged commit 2180db1 into master Apr 24, 2023
@vtjnash vtjnash deleted the jn/avoid-ub-bits branch April 24, 2023 22:44
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.

3 participants