public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Small cleanup/memory leak plugs for lto
Date: Mon, 08 Oct 2012 20:05:00 -0000	[thread overview]
Message-ID: <50733211.5030602@net-b.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

Some more issues found by Coverity scanner.

lto-cgraph.c: The code seems to be unused, besides, it's a zero-trip 
loop as parm_num is set to 0 and then checked non nonzeroness.

lto-opts: The check whether first_p is non NULL is always false: All 
calls have a variable ref as argument - and first_p is unconditionally 
dereferenced.

lto_obj_file_open: One could check additionally check "lo" is NULL, but 
that has then to be directly after the XCNEW as already lto_file_init 
dereferences "lo".

Build and regtested on x86-64-gnu-linux

Tobias

[-- Attachment #2: patch.diff --]
[-- Type: application/unknown, Size: 5854 bytes --]

             reply	other threads:[~2012-10-08 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 20:05 Tobias Burnus [this message]
2012-10-09  9:21 ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50733211.5030602@net-b.de \
    --to=burnus@net-b.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).