From: scarlet@mit.edu (Benjamin Sean Scarlet)
Subject: exception handling bug
31 Jul 1997 22:20:02 -0700
Sender: mail@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <33E161EC.AB9A1F24.cygnus.gnu-win32@mit.edu>
Reply-To: scarlet@mit.edu
X-Mailer: Mozilla 4.01 [en] (WinNT; I)
MIME-Version: 1.0
Original-To: gnu-win32 Mailing List <gnu-win32@cygnus.com>
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-Sender: owner-gnu-win32@cygnus.com

I'm running g++ from gnuwin32/b18, and wrote to this list a few days ago
noting that code in an exception handler is clobbering the this pointer
in the following test code:

void X::foo()
{
  cout << this << endl;
  try { throw 1; } catch(int) { cout << this << endl; }
  cout << this << endl;
}

After looking at the assember and the high level RTL, it looks like two
soft registers, one in the outer scope and one in the catch block, are
both getting mapped to the same hard register.  I'm not sufficiently
initiated into the inner mysteries of the exception handling mechanism
to be sure what the best way to handle this is.  I have ideas, but I'm
not sure what I'd muck up if I tried a fix.  Is there anyone out there
who both is knowledgable about stuff and has the time to answer a few
questions?  I'd like to hammer out a patch for this thing.

	Benjamin Scarlet
	MIT Center for Theoretical Physics
	scarlet@mit.edu
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
