|
The initial version of ExceptionInfoWriter.cpp encodes a landingpad's
"cleanup" clause the same as "catch i8* null" (a catch-all).
But it turns out we do want to distinguish these two: If an uncaught
exception occurs, we don't want the runtime to run C++ destructors
(cleanups), because this involves unwinding the stack to jump to
landingpads, which loses the context of where the uncaught exception
was thrown from, which is unhelpful for debugging. (The C++ standard
says it's optional whether destructors are run when an uncaught
exception occurs.)
So, change the encoding as follows:
* Use 0 as the ID for "cleanup" clauses.
* Add 1 to the IDs of types and "catch" clauses. (Adding 1 to both
seems neater than just one of them.)
* This means we can use 0 for the terminator of filter lists instead
of -1, which seems a little neater.
This requires a corresponding change to eh_pnacl.cc in libsupc++.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
TEST=NaCl's EH tests with libsupc++ change applied
Review URL: https://codereview.chromium.org/69923008
|