ghc-heap: Fix writing closures on big endian
authorPeter Trommler <ptrommler@acm.org>
Mon, 15 Oct 2018 17:51:53 +0000 (13:51 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 15 Oct 2018 22:34:17 +0000 (18:34 -0400)
commit058c2813d882266309e8045af7a72eedecbf2dbb
tree564a33abed0d3920b200e562c49f30ae79568953
parent95ec7c88c7223508db3ba91d6ab9e303d0b062ad
ghc-heap: Fix writing closures on big endian

We need to write the closure type as a HalfWord not
an Int. On big endian systems the closure type ends up being zero
(the upper word of the Int) making the closure an invalid object.

Test Plan: validate (preferably on a big endian system)

Reviewers: bgamari, hvr, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5212
libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc