[scudo] [standalone] [NFC] clang-format code.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Thu, 10 Dec 2020 20:16:45 +0000 (12:16 -0800)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Thu, 10 Dec 2020 20:25:42 +0000 (12:25 -0800)
clang-format the scudo standalone codebase.

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D93056

compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp
compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp

index d29f515..f20a8a8 100644 (file)
@@ -22,21 +22,25 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *Data, size_t Size) {
   uintptr_t FaultAddr = FDP.ConsumeIntegral<uintptr_t>();
   uintptr_t MemoryAddr = FDP.ConsumeIntegral<uintptr_t>();
 
-  std::string MemoryAndTags = FDP.ConsumeRandomLengthString(FDP.remaining_bytes());
+  std::string MemoryAndTags =
+      FDP.ConsumeRandomLengthString(FDP.remaining_bytes());
   const char *Memory = MemoryAndTags.c_str();
   // Assume 16-byte alignment.
   size_t MemorySize = (MemoryAndTags.length() / 17) * 16;
   const char *MemoryTags = Memory + MemorySize;
 
-  std::string StackDepotBytes = FDP.ConsumeRandomLengthString(FDP.remaining_bytes());
+  std::string StackDepotBytes =
+      FDP.ConsumeRandomLengthString(FDP.remaining_bytes());
   std::vector<char> StackDepot(sizeof(scudo::StackDepot), 0);
-  for (size_t i = 0; i < StackDepotBytes.length() && i < StackDepot.size(); ++i) {
+  for (size_t i = 0; i < StackDepotBytes.length() && i < StackDepot.size();
+       ++i) {
     StackDepot[i] = StackDepotBytes[i];
   }
 
   std::string RegionInfoBytes = FDP.ConsumeRemainingBytesAsString();
   std::vector<char> RegionInfo(AllocatorT::getRegionInfoArraySize(), 0);
-  for (size_t i = 0; i < RegionInfoBytes.length() && i < RegionInfo.size(); ++i) {
+  for (size_t i = 0; i < RegionInfoBytes.length() && i < RegionInfo.size();
+       ++i) {
     RegionInfo[i] = RegionInfoBytes[i];
   }
 
index 82f37b6..8b17be0 100644 (file)
@@ -19,9 +19,8 @@ struct Alloc {
 };
 
 size_t measureWastage(const std::vector<Alloc> &allocs,
-                       const std::vector<size_t> &classes,
-                       size_t pageSize,
-                       size_t headerSize) {
+                      const std::vector<size_t> &classes, size_t pageSize,
+                      size_t headerSize) {
   size_t totalWastage = 0;
   for (auto &a : allocs) {
     size_t sizePlusHeader = a.size + headerSize;
@@ -55,7 +54,8 @@ void readAllocs(std::vector<Alloc> &allocs, const char *path) {
   }
 
   Alloc a;
-  while (fscanf(f, "<alloc size=\"%zu\" count=\"%zu\"/>\n", &a.size, &a.count) == 2)
+  while (fscanf(f, "<alloc size=\"%zu\" count=\"%zu\"/>\n", &a.size,
+                &a.count) == 2)
     allocs.push_back(a);
   fclose(f);
 }
@@ -157,5 +157,6 @@ struct MySizeClassConfig {
   };
   static const uptr SizeDelta = %zu;
 };
-)", headerSize);
+)",
+         headerSize);
 }