mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 02:00:26 +02:00
Fix FFI struct sizing to account for trailing padding.
* libguile/foreign.c (scm_sizeof): Make sure the overall size is a multiple of the alignment of the structure. * test-suite/tests/foreign.test: Test size of { double, int8 }.
This commit is contained in:
parent
a722bcaa13
commit
cff1d39b20
2 changed files with 6 additions and 1 deletions
|
@ -303,6 +303,10 @@
|
|||
(= (sizeof (list int8 double))
|
||||
(+ (alignof double) (sizeof double))))
|
||||
|
||||
(pass-if "sizeof { double, int8 }"
|
||||
(= (sizeof (list double int8))
|
||||
(+ (alignof double) (sizeof double))))
|
||||
|
||||
(pass-if "sizeof { short, int, long, pointer }"
|
||||
(let ((layout (list short int long '*)))
|
||||
(>= (sizeof layout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue