[commit: ghc] master: Check correct variable for NULL (6ed7123)

git at git.haskell.org git at git.haskell.org
Sun Apr 27 11:45:46 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6ed7123dcc24c343a1ece85c7aa72ac1c34e6aff/ghc

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

commit 6ed7123dcc24c343a1ece85c7aa72ac1c34e6aff
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>


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

6ed7123dcc24c343a1ece85c7aa72ac1c34e6aff
 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