[commit: haddock] master: Remove potentially dangerous record access in hyperlinker AST module. (a861470)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:42:49 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/a86147030e0f8fe33ebd4b358ac04d3beb45c3f8

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

commit a86147030e0f8fe33ebd4b358ac04d3beb45c3f8
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Sat Jul 4 17:15:26 2015 +0200

    Remove potentially dangerous record access in hyperlinker AST module.


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

a86147030e0f8fe33ebd4b358ac04d3beb45c3f8
 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
index 1e121c2..9d5c127 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
@@ -137,9 +137,9 @@ decls (group, _, _, _) = concatMap ($ group)
   where
     typ (GHC.L _ t) = case t of
         GHC.DataDecl name _ _ _ -> pure . decl $ name
+        GHC.SynDecl name _ _ _ -> pure . decl $ name
         GHC.FamDecl fam -> pure . decl $ GHC.fdLName fam
         GHC.ClassDecl{..} -> [decl tcdLName] ++ concatMap sig tcdSigs
-        _ -> pure . decl $ GHC.tcdLName t
     fun term = case cast term of
         (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name))
             | GHC.isExternalName name -> pure (sspan, RtkDecl name)



More information about the ghc-commits mailing list