FishingCactus/emscripten — comment on commit 3ccc3bcbd541282638813544a104112f5682a979
File: system/lib/libcxx/exception.cpp line 99
By ehsan:

This is not quite correct.

According to the cxx-abi (http://sourcery.mentor.com/public/cxx-abi/abi-eh.html#cxx-catch), the uncaught_exception flag should be cleared inside __cxa_begin_catch(), but the llvm_eh_exception pointer gets cleared inside __cxa_end_catch. With my test, the third test (calling uncaught_exception() within the catch block) fails with this patch. But my JS implementation gets it right, since it decrements the counter inside __cxa_begin_catch.