public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/55617] static constructors are not being instrumented correctly on darwin
Date: Sat, 02 Feb 2013 08:47:00 -0000	[thread overview]
Message-ID: <bug-55617-4-chUtTSVMKW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55617-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-02 08:46:55 UTC ---
} ctor_record;

Why?  }; should be enough IMHO in C++.  Or does GTY still require it?

int ctor_index = -1;

... ctor_index++

What is this for?  Just use vec_safe_length (ctors) instead.

int sort_ctor_records (const void * a, const void * b)

Wrong formatting:

static int
sort_ctor_records (const void *a, const void *b)

ctor_recA etc. names are just too ugly, use ca and cb instead?

void finalize_ctors() {

Again, wrong formatting:

static void
finalize_ctors ()
{

  if (ctors->length() > 1) 
    {
      ctors->qsort (sort_ctor_records);
      ctors->qsort (sort_ctor_records);
    } 

Just use
  if (vec_safe_length (ctors) > 1)
    {
      ctors->qsort (sort_ctor_records);

otherwise it might crash if ctors is still NULL.  Also, you don't need two
qsort calls.

vec_free is probably useless that late in the compilation process, I doubt
there is any GC collection after that point, but not wrong.

  if (ctors)
    finalize_ctors();

This should be if (!vec_safe_is_empty (ctors))


  parent reply	other threads:[~2013-02-02  8:47 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07 14:47 [Bug sanitizer/55617] New: " howarth at nitro dot med.uc.edu
2012-12-07 14:49 ` [Bug sanitizer/55617] " howarth at nitro dot med.uc.edu
2012-12-07 14:50 ` howarth at nitro dot med.uc.edu
2012-12-07 15:44 ` howarth at nitro dot med.uc.edu
2012-12-08  3:25 ` howarth at nitro dot med.uc.edu
2013-01-29  9:50 ` glider at google dot com
2013-01-29  9:59 ` glider at google dot com
2013-01-29 11:56 ` glider at google dot com
2013-01-29 22:05 ` howarth at nitro dot med.uc.edu
2013-01-29 22:15 ` howarth at nitro dot med.uc.edu
2013-01-30 12:29 ` glider at google dot com
2013-01-30 14:24 ` howarth at nitro dot med.uc.edu
2013-01-30 14:33 ` glider at google dot com
2013-01-30 14:42 ` jakub at gcc dot gnu.org
2013-01-30 15:57 ` howarth at nitro dot med.uc.edu
2013-01-30 16:29 ` howarth at nitro dot med.uc.edu
2013-01-30 16:31 ` howarth at nitro dot med.uc.edu
2013-01-30 16:32 ` jakub at gcc dot gnu.org
2013-01-30 16:36 ` kcc at gcc dot gnu.org
2013-01-30 16:43 ` jakub at gcc dot gnu.org
2013-01-30 17:08 ` glider at google dot com
2013-01-30 17:30 ` glider at google dot com
2013-01-30 23:41 ` howarth at nitro dot med.uc.edu
2013-01-31 22:02 ` howarth at nitro dot med.uc.edu
2013-01-31 22:23 ` howarth at nitro dot med.uc.edu
2013-01-31 22:26 ` howarth at nitro dot med.uc.edu
2013-02-01  2:30 ` howarth at nitro dot med.uc.edu
2013-02-01  2:34 ` howarth at nitro dot med.uc.edu
2013-02-01  3:00 ` howarth at nitro dot med.uc.edu
2013-02-01  5:52 ` howarth at nitro dot med.uc.edu
2013-02-01  7:31 ` jakub at gcc dot gnu.org
2013-02-01 16:47 ` howarth at nitro dot med.uc.edu
2013-02-01 21:23 ` howarth at nitro dot med.uc.edu
2013-02-01 21:45 ` howarth at nitro dot med.uc.edu
2013-02-01 22:20 ` jakub at gcc dot gnu.org
2013-02-02  5:51 ` howarth at nitro dot med.uc.edu
2013-02-02  8:47 ` jakub at gcc dot gnu.org [this message]
2013-02-02 15:32 ` howarth at nitro dot med.uc.edu
2013-02-02 15:39 ` jakub at gcc dot gnu.org
2013-02-02 18:17 ` howarth at nitro dot med.uc.edu
2013-02-02 19:20 ` mrs at gcc dot gnu.org
2013-02-02 20:11 ` howarth at nitro dot med.uc.edu
2013-02-02 20:12 ` howarth at nitro dot med.uc.edu
2013-02-02 20:20 ` howarth at nitro dot med.uc.edu
2013-02-02 20:41 ` howarth at nitro dot med.uc.edu
2013-02-02 22:54 ` howarth at nitro dot med.uc.edu
2013-02-03  0:10 ` howarth at nitro dot med.uc.edu
2013-02-03 15:17 ` howarth at nitro dot med.uc.edu
2013-02-04 10:11 ` glider at google dot com
2013-02-04 10:14 ` glider at google dot com
2013-02-04 17:25 ` howarth at nitro dot med.uc.edu
2013-02-04 20:08 ` mrs at gcc dot gnu.org
2013-02-04 21:08 ` mrs at gcc dot gnu.org
2013-02-04 21:11 ` mrs at gcc dot gnu.org
2013-02-11 22:36 ` mrs at gcc dot gnu.org

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=bug-55617-4-chUtTSVMKW@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).