Changeset 279916 in webkit for trunk/Source/JavaScriptCore/jit/ExecutableAllocationFuzz.cpp
- Timestamp:
- Jul 14, 2021, 12:58:16 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/ExecutableAllocationFuzz.cpp
r279126 r279916 42 42 ExecutableAllocationFuzzResult doExecutableAllocationFuzzing() 43 43 { 44 static WeakRandom random(Options::seedOfVMRandomForFuzzer() ? Options::seedOfVMRandomForFuzzer() : cryptographicallyRandomNumber()); 45 44 46 ASSERT(Options::useExecutableAllocationFuzz()); 45 47 … … 60 62 } 61 63 62 unsigned oldValue; 63 unsigned newValue; 64 do { 65 oldValue = s_numberOfExecutableAllocationFuzzChecks.load(); 66 newValue = oldValue + 1; 67 } while (!s_numberOfExecutableAllocationFuzzChecks.compareExchangeWeak(oldValue, newValue)); 68 69 if (newValue == Options::fireExecutableAllocationFuzzAt()) { 64 unsigned numChecks = s_numberOfExecutableAllocationFuzzChecks.value++; 65 66 if (numChecks == Options::fireExecutableAllocationFuzzAt()) { 70 67 if (Options::verboseExecutableAllocationFuzz()) { 71 68 dataLog("Will pretend to fail executable allocation.\n"); … … 74 71 return PretendToFailExecutableAllocation; 75 72 } 76 73 77 74 if (Options::fireExecutableAllocationFuzzAtOrAfter() 78 && n ewValue>= Options::fireExecutableAllocationFuzzAtOrAfter()) {75 && numChecks >= Options::fireExecutableAllocationFuzzAtOrAfter()) { 79 76 if (Options::verboseExecutableAllocationFuzz()) { 80 77 dataLog("Will pretend to fail executable allocation.\n"); … … 82 79 } 83 80 return PretendToFailExecutableAllocation; 84 } 81 } else if (!Options::fireExecutableAllocationFuzzAt() && random.getUint32() < UINT_MAX * Options::randomIntegrityAuditRate()) 82 return PretendToFailExecutableAllocation; 85 83 86 84 return AllowNormalExecutableAllocation;
Note:
See TracChangeset
for help on using the changeset viewer.