[commit: ghc] wip/T14626: WIP: barf differently when a banged field is not tagged (fbb63fc)

git at git.haskell.org git at git.haskell.org
Thu Feb 8 14:56:52 UTC 2018


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

On branch  : wip/T14626
Link       : http://ghc.haskell.org/trac/ghc/changeset/fbb63fcb8bf8424ae5c07bc0d9257609794b16ce/ghc

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

commit fbb63fcb8bf8424ae5c07bc0d9257609794b16ce
Author: Gabor Greif <ggreif at gmail.com>
Date:   Thu Feb 8 15:55:38 2018 +0100

    WIP: barf differently when a banged field is not tagged


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

fbb63fcb8bf8424ae5c07bc0d9257609794b16ce
 compiler/codeGen/StgCmmCon.hs | 2 +-
 rts/Apply.cmm                 | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index 6415370..2368f14 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -270,7 +270,7 @@ buildDynCon' dflags _ binder actually_bound ccs con args
                          lgood lcall Nothing
                 pprTrace "checkTagOnPtr" (ppr con $$ ppr (dataConRepType con)) emitLabel lcall
                 emitRtsCall rtsUnitId
-                  (fsLit "checkTagged") [(p, AddrHint)] False
+                  (fsLit "checkBangTagged") [(p, AddrHint)] False
                 emitLabel lgood
       checkTagOnPtr _ _ = pure ()
 
diff --git a/rts/Apply.cmm b/rts/Apply.cmm
index 7bbf610..1c7c7bd 100644
--- a/rts/Apply.cmm
+++ b/rts/Apply.cmm
@@ -20,6 +20,14 @@ checkTagged ( P_ obj )
     return();
 }
 
+checkBangTagged ( P_ obj )
+{
+    if (GETTAG(obj)==0) {
+        ccall barf("BANG NOT TAGGED! ") never returns;
+    }
+    return();
+}
+
 
 /* ----------------------------------------------------------------------------
  * Evaluate a closure and return it.



More information about the ghc-commits mailing list