[cfe-commits] [libcxxabi] r148750 - /libcxxabi/trunk/src/cxa_exception_storage.cpp

John McCall rjmccall at apple.com
Wed Jan 25 09:28:03 PST 2012


On Jan 23, 2012, at 3:55 PM, Howard Hinnant wrote:
> Author: hhinnant
> Date: Mon Jan 23 17:55:58 2012
> New Revision: 148750
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=148750&view=rev
> Log:
> A lot of the code in cxa_exception.cpp depends on __cxa_get_globals_fast() returning null if __cxa_get_globals() hasn't been called yet.  However it doesn't reliably do that, at least on OS X if __cxa_get_globals_fast() is called prior to pthread_key_create() running.  Our choice is to either limit our use of __cxa_get_globals_fast() more than we have, or to have __cxa_get_globals_fast() initialize with pthread_key_create() if necessary.  I chose the latter, and replaced pthread_once with a C++11 local static (which should do the same thing).

Are you certain this function is not used in the implementation of _cxa_guard_acquire?  If so, please at least document in the guard-variables code that it is no longer allowed to call this.

John.



More information about the cfe-commits mailing list