public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/25962]  New: Pointer (null) check after the use
@ 2006-01-26  0:09 uttamp at us dot ibm dot com
  2006-01-26  0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: uttamp at us dot ibm dot com @ 2006-01-26  0:09 UTC (permalink / raw)
  To: gcc-bugs

In file gcc/cgraphunit.c, function verify_cgraph_node(struct cgraph_node
*node), the input argument 'node' has been dereferenced before doing any
checking till on line 717 with following codition,
...
717 if (!node)
718    {
719      error ("node not found in DECL_ASSEMBLER_NAME hash");
720      error_found = true;
721    }
...

Shouldn't this code be moved at the begining of this function? before
de-referencing it?

Also, on line 789-793, if there is any error, we call dump_cgraph_node(), which
dumps the cgraph node. Shouldn't we do a check for non-null 'node', either here
before calling or in function dump_cgraph_node() itself? This has been,
reported as a possible error by 'coverity prevent tool'.

Any thoughts?


-- 
           Summary: Pointer (null) check after the use
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uttamp at us dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25962


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-05-08 21:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26  0:09 [Bug tree-optimization/25962] New: Pointer (null) check after the use uttamp at us dot ibm dot com
2006-01-26  0:12 ` [Bug tree-optimization/25962] " pinskia at gcc dot gnu dot org
2006-01-26 11:06 ` rguenth at gcc dot gnu dot org
2006-01-26 21:27 ` pinskia at gcc dot gnu dot org
2006-04-30 13:48 ` [Bug middle-end/25962] Pointer (null) check after the use in cgraph.c hubicka at gcc dot gnu dot org
2006-05-04 12:43 ` hubicka at gcc dot gnu dot org
2006-05-08  7:16 ` pinskia at gcc dot gnu dot org
2006-05-08 21:42 ` hubicka at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).