[Git][ghc/ghc][wip/ghc-debug] Cleanup getClosureX

Sven Tennie gitlab at gitlab.haskell.org
Tue May 12 07:06:41 UTC 2020



Sven Tennie pushed to branch wip/ghc-debug at Glasgow Haskell Compiler / GHC


Commits:
8eea2214 by Sven Tennie at 2020-05-12T09:04:59+02:00
Cleanup getClosureX

Compiler warnings make the CI build fail.

- - - - -


1 changed file:

- libraries/ghc-heap/GHC/Exts/Heap.hs


Changes:

=====================================
libraries/ghc-heap/GHC/Exts/Heap.hs
=====================================
@@ -294,28 +294,24 @@ getClosureX get_closure_raw x = do
                 fail $ "Expected 6 ptr arguments to TSO, found "
                         ++ show (length pts)
 
-            threadId' <- allocaArray (length wds) (\ptr -> do
+            allocaArray (length wds) (\ptr -> do
                 pokeArray ptr wds
-                id <- peekStgThreadID ptr
-                return id
-                )
-            alloc_limit' <- allocaArray (length wds) (\ptr -> do
-                pokeArray ptr wds
-                alloc_limit <- peekAllocLimit ptr
-                return alloc_limit
-                )
 
-            pure $ TSOClosure
-                { info = itbl
-                , _link = (pts !! 0)
-                , global_link = (pts !! 1)
-                , tsoStack = (pts !! 2)
-                , trec = (pts !! 3)
-                , blocked_exceptions = (pts !! 4)
-                , bq = (pts !! 5)
-                , threadId = threadId'
-                , alloc_limit = alloc_limit'
-                }
+                threadId' <- peekStgThreadID ptr
+                alloc_limit' <- peekAllocLimit ptr
+
+                pure $ TSOClosure
+                    { info = itbl
+                    , _link = (pts !! 0)
+                    , global_link = (pts !! 1)
+                    , tsoStack = (pts !! 2)
+                    , trec = (pts !! 3)
+                    , blocked_exceptions = (pts !! 4)
+                    , bq = (pts !! 5)
+                    , threadId = threadId'
+                    , alloc_limit = alloc_limit'
+                    }
+                )
         STACK -> do
             unless (length pts >= 1) $
                 fail $ "Expected at least 1 ptr argument to STACK, found "
@@ -338,4 +334,3 @@ getClosureX get_closure_raw x = do
 -- | Like 'getClosureDataX', but taking a 'Box', so it is easier to work with.
 getBoxedClosureData :: Box -> IO Closure
 getBoxedClosureData (Box a) = getClosureData a
-



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8eea22144a0f22df1c7a6e500b99458101d8570e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8eea22144a0f22df1c7a6e500b99458101d8570e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200512/4e326a61/attachment-0001.html>


More information about the ghc-commits mailing list