diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2023-02-17 00:51:04 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-27 23:16:14 +0100 |
commit | d69cf5529d3fdbbfd3d1d6b429a67f912e3c4f44 (patch) | |
tree | 034c8fedbfd86d1ed00036ae657cb4cebaa0c499 | |
parent | 5cf9885fde9c9697e4adade00cd71beb8bf4624b (diff) | |
download | mig-d69cf5529d3fdbbfd3d1d6b429a67f912e3c4f44.tar.gz mig-d69cf5529d3fdbbfd3d1d6b429a67f912e3c4f44.tar.bz2 mig-d69cf5529d3fdbbfd3d1d6b429a67f912e3c4f44.zip |
Also align mach_msg_type_long_t to complex_alignof
This was a miss in the previous patch given that mach_msg_type_long_t is
12 bytes long so won't neatly align to 8 bytes.
Message-Id: <Y+8VyADQ8+bRRUcp@jupiter.tail36e24.ts.net>
-rw-r--r-- | utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -304,9 +304,14 @@ WriteFieldDeclPrim(FILE *file, const argument_t *arg, fprintf(file, "\t\tmach_msg_type_%st %s;\n", arg->argLongForm ? "long_" : "", arg->argTTName); - if (!arg->argLongForm && complex_alignof > sizeof_mach_msg_type_t) { - /* Pad mach_msg_type_t in case we need alignment by more than its size. */ - fprintf(file, "\t\tchar %s_pad[%d];\n", arg->argTTName, complex_alignof - sizeof_mach_msg_type_t); + + /* Pad mach_msg_type_t/mach_msg_type_long_t in case we need alignment by more than its size. */ + if (!arg->argLongForm && sizeof_mach_msg_type_t % complex_alignof) { + fprintf(file, "\t\tchar %s_pad[%d];\n", + arg->argTTName, complex_alignof - sizeof_mach_msg_type_t % complex_alignof); + } else if (arg->argLongForm && sizeof_mach_msg_type_long_t % complex_alignof) { + fprintf(file, "\t\tchar %s_pad[%d];\n", arg->argTTName, + complex_alignof - sizeof_mach_msg_type_long_t % complex_alignof); } if (it->itInLine && it->itVarArray) |