[PATCH] FFI: Fix pass small ints in foreign call wrappers
authorPeter Trommler <ptrommler@acm.org>
Thu, 11 Jun 2020 06:31:22 +0000 (08:31 +0200)
committerGianfranco Costamagna <locutusofborg@debian.org>
Wed, 23 Dec 2020 22:15:42 +0000 (22:15 +0000)
commit892c14233b6b5f2e83c7a69b206e9bd17fc9e5aa
treeac7bc45201197727e9527fca5283c8a45a7e6cb3
parentdd8257a8250f61b0d891f2a17ede9657b5a6bd00
[PATCH] FFI: Fix pass small ints in foreign call wrappers

The Haskell calling convention requires integer parameters smaller
than wordsize to be promoted to wordsize (where the upper bits are
don't care). To access such small integer parameter read a word from
the parameter array and then cast that word to the small integer
target type.

Fixes #15933

Gbp-Pq: Name fix-big-endian-ffi
compiler/deSugar/DsForeign.hs