diff options
author | Cheng Shao <terrorjack@type.dance> | 2023-01-27 14:29:38 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2023-02-01 13:18:47 +0000 |
commit | adf17604bc6b3eebb66b063383156a722718c2fb (patch) | |
tree | a97fbd085ecce1e8604fd925fa0f9c10546bf4f9 /compiler | |
parent | fdfd89117b20f064f38cb61a35cb234b22ec0a0e (diff) | |
download | haskell-adf17604bc6b3eebb66b063383156a722718c2fb.tar.gz |
compiler: fix lowering of CmmBlock in the wasm NCG
The CmmBlock datacon was not handled in lower_CmmLit, since I thought
it would have been eliminated after proc-point splitting. Turns out it
still occurs in very rare occasions, and this patch is needed to fix
T9329 for wasm.
(cherry picked from commit 6ea2aa0293aedea2f873b7b5d9cff5e7b9e2f188)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/CmmToAsm/Wasm/FromCmm.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs b/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs index 2a2fafda4a..c07399836a 100644 --- a/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs +++ b/compiler/GHC/CmmToAsm/Wasm/FromCmm.hs @@ -31,6 +31,7 @@ import Data.String import Data.Traversable import Data.Type.Equality import GHC.Cmm +import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Label @@ -861,6 +862,7 @@ lower_CmmLit lit = do WasmSymConst sym `WasmConcat` WasmConst ty_word (toInteger o) `WasmConcat` WasmAdd ty_word + CmmBlock bid -> lower_CmmLit $ CmmLabel $ infoTblLbl bid _ -> panic "lower_CmmLit: unreachable" -- | Lower a 'CmmReg'. Some of the logic here wouldn't be needed if |