[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)
committerIlias Tsitsimpis <iliastsi@debian.org>
Sun, 3 Oct 2021 11:27:00 +0000 (12:27 +0100)
commitaec8053bd670d081454b89a0eaf81a37b72b8547
treeec16235cd2b2f12bff381c7dbfaffd0d00348c19
parent8d1a29730345ab111a0b3dbc9d1e0c4c647e364d
[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