projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
077d5cb
)
Use volatile store for g_hrFatalError
author
Jan Kotas
<jkotas@microsoft.com>
Thu, 12 Nov 2015 01:48:49 +0000
(17:48 -0800)
committer
Jan Kotas
<jkotas@microsoft.com>
Thu, 12 Nov 2015 01:48:49 +0000
(17:48 -0800)
src/utilcode/ex.cpp
patch
|
blob
|
history
diff --git
a/src/utilcode/ex.cpp
b/src/utilcode/ex.cpp
index
d3e0393
..
e692e13
100644
(file)
--- a/
src/utilcode/ex.cpp
+++ b/
src/utilcode/ex.cpp
@@
-1698,7
+1698,8
@@
void DECLSPEC_NORETURN ThrowOutOfMemory()
#ifndef DACCESS_COMPILE
- g_hrFatalError = COR_E_OUTOFMEMORY;
+ // Use volatile store to prevent compiler from optimizing the static variable away
+ VolatileStoreWithoutBarrier<HRESULT>(&g_hrFatalError, COR_E_OUTOFMEMORY);
// Regular CLR builds - throw our pre-created OOM exception object
PAL_CPP_THROW(Exception *, Exception::GetOOMException());