diff dyncall/dyncall_aggregate_x64.c @ 546:ba70fb631bea

x64: * support for non-standard aggr-by-value packing (#pragma pack, etc.) * callbacks: handling callconv prefixes in signature
author Tassilo Philipp
date Tue, 31 May 2022 19:29:34 +0200
parents a73a5cd50c19
children eef302b7a58d
line wrap: on
line diff
--- a/dyncall/dyncall_aggregate_x64.c	Tue May 31 18:35:06 2022 +0200
+++ b/dyncall/dyncall_aggregate_x64.c	Tue May 31 19:29:34 2022 +0200
@@ -69,6 +69,10 @@
     if(offset >= (qword_offset + DC_ONE_8BYTE) || (offset + f->size * f->array_len) <= qword_offset)
       continue;
 
+    /* if field is unaligned, class is MEMORY */
+    if(f->alignment && (offset % f->alignment) != 0)
+      return SYSVC_MEMORY;
+
     DCuchar new_class = SYSVC_NONE;
 
     switch (f->type) {