You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried a couple of different combinations of types instead of <3 x i8>, and I don't understand the results:
i24: Issue persists, 144 is returned.
[3 x i8]: 0 is returned (expected result).
<{i8, i8, i8}>: 0 is returned.
Interestingly the assembly language for the i24 and <3 x i8> cases is different, but returns the same bogus value. both seem to copy a 32-bit dword value of 0 to the stack, and then read the fifth byte ([rax + 4]) into al. I believe this should be the fourth byte instead ([rax + 3]). Though the registers end up being different, in the array and packed structure cases (which produce identical assembly) this is the case.
This test program returns
0
in vellvm (which is what I expect), and144
with clang:Not sure what clang is doing. The issue persists even without the size 0 memory of the structure:
However, the issue disappears when directly allocating a packed structure, instead of using ptoi / itop to cast to a packed structure.
The text was updated successfully, but these errors were encountered: