This is the mail archive of the gcc-bugs@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()


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]