Changeset 279126 in webkit for trunk/Source/JavaScriptCore/jit/ExecutableAllocationFuzz.cpp
- Timestamp:
- Jun 22, 2021, 10:48:42 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/ExecutableAllocationFuzz.cpp
r278425 r279126 30 30 #include <wtf/Atomics.h> 31 31 #include <wtf/DataLog.h> 32 #include <wtf/WeakRandom.h> 32 33 33 34 namespace JSC { … … 42 43 { 43 44 ASSERT(Options::useExecutableAllocationFuzz()); 45 46 if (Options::fireExecutableAllocationFuzzRandomly()) { 47 static LazyNeverDestroyed<WeakRandom> random; 48 static std::once_flag once; 49 std::call_once(once, [] () { 50 random.construct(); 51 }); 52 53 static Lock fuzzingLock; 54 Locker locker { fuzzingLock }; 55 56 if (random->returnTrueWithProbability(Options::fireExecutableAllocationFuzzRandomlyProbability())) 57 return PretendToFailExecutableAllocation; 58 59 return AllowNormalExecutableAllocation; 60 } 44 61 45 62 unsigned oldValue;
Note:
See TracChangeset
for help on using the changeset viewer.