public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: Richard Henderson <rth@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Kai Tietz <ktietz70@googlemail.com>
Subject: Re: [Patch/RFC] SEH exceptions for Win64
Date: Tue, 17 Jul 2012 07:35:00 -0000	[thread overview]
Message-ID: <66B66CEA-F2C6-4838-B5EB-62963E52C7DF@adacore.com> (raw)
In-Reply-To: <50044132.60906@redhat.com>


On Jul 16, 2012, at 6:28 PM, Richard Henderson wrote:

> On 07/13/2012 07:13 AM, Tristan Gingold wrote:
>> +_Unwind_RaiseException (struct _Unwind_Exception *exc)
>> +{
>> +  memset (exc->private_, 0, sizeof (exc->private_));
>> +
>> +  RaiseException (STATUS_GCC_THROW, 0, 1, (ULONG_PTR *)&exc);
> 
> We almost certainly didn't want pointer-to-pointer...

I was about to say that this is an obvious typo, but no, this code is correct AFAIK.

The declaration of RaiseException is:

void
 WINAPI RaiseException(
  __in  DWORD dwExceptionCode,
  __in  DWORD dwExceptionFlags,
  __in  DWORD nNumberOfArguments,
  __in  const ULONG_PTR *lpArguments
);

That is, the last argument is an array of arguments to be copied into the exception record.
In our case, the start of the array is &exc, and its length is 1.

So, the first element of ExceptionInformation will be exc.

Should I add a comment ?

Tristan.

  reply	other threads:[~2012-07-17  7:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 14:13 Tristan Gingold
2012-07-16 18:53 ` Richard Henderson
2012-07-17  7:35   ` Tristan Gingold [this message]
2012-07-17 12:40     ` Richard Henderson
2012-07-17 12:53       ` Kai Tietz
2012-07-19  7:31         ` Tristan Gingold
2012-07-19  9:38           ` Pedro Alves
2012-07-19 10:15             ` Tristan Gingold
2012-07-19 10:19               ` Pedro Alves
2012-07-25  8:39               ` Tristan Gingold
2012-07-26  0:03                 ` Gerald Pfeifer
2012-07-19 16:55 ` Eric Botcazou
2012-07-20  7:22   ` Tristan Gingold

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=66B66CEA-F2C6-4838-B5EB-62963E52C7DF@adacore.com \
    --to=gingold@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ktietz70@googlemail.com \
    --cc=rth@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).