[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)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 30 Sep 2021 18:21:04 +0000 (19:21 +0100)
commit114baf6480966c80071975f3bc8e391aaf834c4f
treef0fdbced4c4ecc0095b0b6d68f16f12c27c83393
parent521fab11cdd161c0fd9eac8ab9155fedaf19e116
[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