From: Mike Stump <mikestump@comcast.net>
To: Marek Polacek <polacek@redhat.com>
Cc: Jason Merrill <jason@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][ubsan] Add VLA bound instrumentation
Date: Wed, 30 Oct 2013 22:50:00 -0000 [thread overview]
Message-ID: <CAAB8033-6CBB-4579-AE9E-56F07E60F5C9@comcast.net> (raw)
In-Reply-To: <20131030221548.GD31396@redhat.com>
On Oct 30, 2013, at 3:15 PM, Marek Polacek <polacek@redhat.com> wrote:
> I had a quick look at the CLEANUP_STMT and cp-tree.def says
> "A CLEANUP_STMT marks the point at which a declaration is fully
> constructed.", while doc says
> "Used to represent an action that should take place upon exit from the
> enclosing scope. Typically, these actions are calls to destructors for
> local objects." Huh? So, how come it e.g. initializes variables, and on
> the other hand it should run dtors? I'm baffled (but it's too late for me
> to think clearly ;)).
The dtors only run, after the ctors run. We mark where the ctors finish spot, as the _start_ of the region for which we have to clean up. Really, the cleanup has nothing to do with ctors. You can have dtors, without any ctors, or ctors, without any dtors.
{
decl d;
s;
}
transforms into:
<----- start of lifetime of the storage for d
ctor(d)
<----- start of lifetime of the fully constructed object d
s;
<----- end of lifetime of fully constructed object d
dtor(d)
<----- end of the storage of d
CLEANUP_STMT documents when the region protected by the cleanup starts. One want to describe that region is, the end of the ctors, if any, else after the storage is allocated. In the above, that is the second <---- spot.
Now, in the trees, the above is decl d; ctors; CLEANUP_STMT (s, dtors, d).
s is the region for which the cleanups are active for. dtors is the cleanup to perform on transfer out of that region, and d is the decl related to the actions in dtors.
next prev parent reply other threads:[~2013-10-30 22:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 12:38 Marek Polacek
2013-09-12 12:48 ` Marek Polacek
2013-09-12 16:12 ` Joseph S. Myers
2013-09-12 16:20 ` Joseph S. Myers
2013-09-12 17:15 ` Marek Polacek
2013-09-13 10:29 ` Marek Polacek
2013-09-13 11:23 ` Eric Botcazou
2013-09-13 18:01 ` Joseph S. Myers
2013-09-16 11:13 ` Marek Polacek
2013-09-16 13:39 ` Florian Weimer
2013-09-12 16:29 ` Marek Polacek
2013-09-25 13:23 ` Marek Polacek
2013-10-07 20:17 ` Marek Polacek
2013-10-15 13:25 ` Marek Polacek
2013-10-15 15:01 ` Joseph S. Myers
2013-10-24 20:35 ` Jason Merrill
2013-10-25 17:38 ` Marek Polacek
2013-10-25 19:04 ` Jason Merrill
2013-10-25 19:15 ` Marek Polacek
2013-10-25 19:30 ` Jason Merrill
2013-10-30 15:16 ` Marek Polacek
2013-10-30 16:08 ` Jason Merrill
2013-10-30 16:20 ` Marek Polacek
2013-10-30 20:55 ` Mike Stump
2013-10-30 22:46 ` Marek Polacek
2013-10-30 22:50 ` Mike Stump [this message]
2013-10-31 11:12 ` Marek Polacek
2013-10-31 3:18 ` Jason Merrill
2013-10-31 19:07 ` Marek Polacek
2013-11-01 17:35 ` Jason Merrill
2013-11-01 19:10 ` Marek Polacek
2013-11-01 20:39 ` Jason Merrill
2013-11-02 13:06 ` Marek Polacek
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=CAAB8033-6CBB-4579-AE9E-56F07E60F5C9@comcast.net \
--to=mikestump@comcast.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=polacek@redhat.com \
/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).