gecko-dev/mozglue
Toshihito Kikuchi 3694eeda43 Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz
We had a thread-local varialbe `ModuleLoadFrame::sTopFrame` to track the topmost
stack frame of `LdrLoadDll`.  However, our hook function `patched_LdrLoadDll` can
be called even before TLS is initialized.  In such a case, accessing `sTopFrame`
causes AV.

This patch introduces `SafeThreadLocal` to safely access a thread-local varialbe.
If TLS is not initialized, it falls back to a global variable because in that
early stage there is only a single thread running.

Differential Revision: https://phabricator.services.mozilla.com/D55870

--HG--
extra : moz-landing-system : lando
2020-02-07 18:08:11 +00:00
..
android Bug 1598196 - Support disabling the linker on Android in the code. r=froydnj 2019-11-21 14:57:24 +00:00
baseprofiler Bug 1609996 - Fix some things that the automated replacement didn't catch. r=froydnj 2020-01-20 16:18:28 +00:00
build Bug 1602689 - whitelist RegisteredThread::RegisteredThread r=decoder,gerald 2020-01-30 20:21:31 +00:00
dllservices Bug 1610702 - Generalize Vector::podResizeToFit into Vector::shrinkStorageToFit(). r=froydnj 2020-02-03 17:32:12 +00:00
linker Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj 2019-12-20 07:16:43 +00:00
misc Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz 2020-02-07 18:08:11 +00:00
static Bug 1594998 - Make standalone SpiderMonkey use libxul-like panic. r=froydnj 2019-11-15 13:14:42 +00:00
tests Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz 2020-02-07 18:08:11 +00:00
moz.build Bug 1598196 - Support disabling the linker on Android in the code. r=froydnj 2019-11-21 14:57:24 +00:00