This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9588: memory fault when user throws exception from terminate()


The following reply was made to PR c++/9588; it has been noted by GNATS.

From: fwang@ca.ibm.com
To: nathan@gcc.gnu.org, "Frank Wang" <fwang@ca.ibm.com>, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/9588: memory fault when user throws exception from terminate()
Date: Wed, 5 Feb 2003 16:52:25 -0500

 Hi,
 
 I think the real problem in calling terminate() function. according to
 Spec.15.1.8 and Spec.15.5
  If no exception is presently being handled, executing a throw-expression
 with no operand calls terminate() (15.5.1).
 
 If you try to compile and run following codes, you can get different result
 in 32bit gcc and 64bit gcc.
 
 //tmp.cpp
 #include <exception>
 struct S {
         int i;
         S() {i=1;}
 };
 
 int main(void)
 {
 
         try {
                 throw 'a';
         }
         catch (S) {
                 }
         return 0;
 }
 
 
 For 32bit gcc:   actual output: Abort
 For 64ibt gcc:   acutal output: Memory fault
 
 
 
 
 Regards,
 
 
 Frank Wang
 
 VisualAge C/C++ Compiler Test
 IBM Toronto Lab
 Phone:(905) 413 - 2337      TieLine: 969 - 2337
 Email: fwang@ca.ibm.com
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]