This is the mail archive of the 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: Bug in implementation of C++ ABI exception handling?

> > Am I missing something, or should this print "Success" instead of
> > aborting?
> You are correct.

Ok, I'm looking at fixing this (which is now PR12054, btw), but am
slightly stuck.  The code currently wraps the copy-ctor call with a
MUST_NOT_THROW_EXPR, which is why we get the call to terminate.

My initial idea was just to wrap this call up with a CLEANUP_STMT, where
CLEANUP_EH_ONLY(r) = 1 and the CLEANUP_EXPR set to free the exception.  My
problem, however, is that the code in build_throw is building an
expression, not a statement chain.

Would it be best to hack something together with STMT_EXPR's and
EXPR_STMT's to get around this, or would it be better to generalize
MUST_NOT_THROW_EXPR to take an extra argument, which indicates what to do
if an exception is thrown?

It looks like changing the second one would not be difficult: basically,
cxx_expand_expr would just use the stored expression instead of hardcoding
in a call to terminate.



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