Commit 4e2d707
committed
C backend: fix #858 - internal structure size mismatch due to padding differences
A structure which decreases its alignment (using FIELD = n) is annotated with both the "packed" and the "alignment(n)" attributes. That leads to a problem if such a structure is nested inside another structure that uses a greater alignment than the child structure. In that case the field representing the nested structure is aligned with the same properties as the nested structure.
So the alignment has to be increased explicitly if the nested structure is packed with a smaller alignment than the parent structure. That is accomplished by adding the "alignment(n)" attribute to those fields.1 parent 5ee8f12 commit 4e2d707
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1041 | 1058 | | |
1042 | 1059 | | |
1043 | 1060 | | |
| |||
0 commit comments