[commit: ghc] master: Fix globalRegMaybe for unregisterised build. (214ad2d)

git at git.haskell.org git at git.haskell.org
Tue May 13 12:21:07 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/214ad2d24cda4aaef541df3e213d5c4845f95c71/ghc

>---------------------------------------------------------------

commit 214ad2d24cda4aaef541df3e213d5c4845f95c71
Author: Peter Trommler <ptrommler at scm.org>
Date:   Wed Apr 30 11:41:51 2014 +0200

    Fix globalRegMaybe for unregisterised build.
    
    In commit 83a003f globalRegMaybe will be called but panics
    for unregisterised compilers.
    
    In an unregisterised compiler there are no global registers
    so always return `Nothing`.
    
    Fixes #9055.


>---------------------------------------------------------------

214ad2d24cda4aaef541df3e213d5c4845f95c71
 includes/CodeGen.Platform.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
index 3d6dd41..62708cc 100644
--- a/includes/CodeGen.Platform.hs
+++ b/includes/CodeGen.Platform.hs
@@ -742,6 +742,8 @@ globalRegMaybe CurrentTSO               = Just (RealRegSingle REG_CurrentTSO)
 globalRegMaybe CurrentNursery           = Just (RealRegSingle REG_CurrentNursery)
 # endif
 globalRegMaybe _                        = Nothing
+#elif MACHREGS_NO_REGS
+globalRegMaybe _ = Nothing
 #else
 globalRegMaybe = panic "globalRegMaybe not defined for this platform"
 #endif



More information about the ghc-commits mailing list