[commit: ghc] ghc-7.8: Check correct variable for NULL (27337de)

git at git.haskell.org git at git.haskell.org
Sun Apr 27 14:44:26 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/27337de5999e43807131acb290447e4ab8aa334c/ghc

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

commit 27337de5999e43807131acb290447e4ab8aa334c
Author: Nicolas Trangez <ikke at nicolast.be>
Date:   Wed Apr 23 20:37:51 2014 +0200

    Check correct variable for NULL
    
    Issue discovered by Coverity scan, CID 43163. This should fix CID 43172 as a
    side-effect as well.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>
    (cherry picked from commit 6ed7123dcc24c343a1ece85c7aa72ac1c34e6aff)


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

27337de5999e43807131acb290447e4ab8aa334c
 rts/Hpc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/Hpc.c b/rts/Hpc.c
index c4ff8d3..47d1acd 100644
--- a/rts/Hpc.c
+++ b/rts/Hpc.c
@@ -151,7 +151,7 @@ readTix(void) {
     ws();
     
     lookup = lookupHashTable(moduleHash, (StgWord)tmpModule->modName);
-    if (tmpModule == NULL) {
+    if (lookup == NULL) {
         debugTrace(DEBUG_hpc,"readTix: new HpcModuleInfo for %s",
                    tmpModule->modName);
         insertHashTable(moduleHash, (StgWord)tmpModule->modName, tmpModule);



More information about the ghc-commits mailing list