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
parent
87102928
No related branches found
No related tags found
Pipeline #20806 passed with warnings
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/HsToCore/Foreign/Decl.hs 26 additions, 5 deletionscompiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/StgToCmm/Foreign.hs 1 addition, 1 deletioncompiler/GHC/StgToCmm/Foreign.hs
- testsuite/tests/ffi/should_run/Makefile 6 additions, 0 deletionstestsuite/tests/ffi/should_run/Makefile
- testsuite/tests/ffi/should_run/T15933.h 2 additions, 0 deletionstestsuite/tests/ffi/should_run/T15933.h
- testsuite/tests/ffi/should_run/T15933.hs 17 additions, 0 deletionstestsuite/tests/ffi/should_run/T15933.hs
- testsuite/tests/ffi/should_run/T15933.stdout 1 addition, 0 deletionstestsuite/tests/ffi/should_run/T15933.stdout
- testsuite/tests/ffi/should_run/T15933_c.c 7 additions, 0 deletionstestsuite/tests/ffi/should_run/T15933_c.c
- testsuite/tests/ffi/should_run/all.T 2 additions, 0 deletionstestsuite/tests/ffi/should_run/all.T
testsuite/tests/ffi/should_run/T15933.h
0 → 100644
testsuite/tests/ffi/should_run/T15933.hs
0 → 100644
testsuite/tests/ffi/should_run/T15933.stdout
0 → 100644
testsuite/tests/ffi/should_run/T15933_c.c
0 → 100644
Please register or sign in to comment