[commit: testsuite] master: Fix dangling pointer reference in T8242 (de87db8)

git at git.haskell.org git at git.haskell.org
Fri Oct 25 14:23:36 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/de87db840e01ed8acdf453185dbc45e019b5c565/testsuite

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

commit de87db840e01ed8acdf453185dbc45e019b5c565
Author: Takano Akio <aljee at hyper.cx>
Date:   Thu Oct 24 21:44:36 2013 +0900

    Fix dangling pointer reference in T8242
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

de87db840e01ed8acdf453185dbc45e019b5c565
 tests/rts/T8242.hs |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/rts/T8242.hs b/tests/rts/T8242.hs
index a8dcef5..bbdf4bf 100644
--- a/tests/rts/T8242.hs
+++ b/tests/rts/T8242.hs
@@ -13,7 +13,8 @@ import GHC.Exts
 foreign import ccall unsafe "&puts" puts :: FunPtr (Ptr CChar -> IO ())
 
 main :: IO ()
-main = alloca $ \ptr@(Ptr p) -> do
+main = do
+  ptr@(Ptr p) <- malloc
   poke (ptr :: Ptr CChar) 0
   setNumCapabilities 2
   let !(FunPtr puts#) = puts



More information about the ghc-commits mailing list