[PATCH] D104758: [scudo] Handle predefined M_MEMTAG_TUNING_* constants (NFC).

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 16:44:40 PDT 2021


eugenis updated this revision to Diff 353822.
eugenis added a comment.

another typo


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104758/new/

https://reviews.llvm.org/D104758

Files:
  compiler-rt/lib/scudo/standalone/include/scudo/interface.h


Index: compiler-rt/lib/scudo/standalone/include/scudo/interface.h
===================================================================
--- compiler-rt/lib/scudo/standalone/include/scudo/interface.h
+++ compiler-rt/lib/scudo/standalone/include/scudo/interface.h
@@ -120,7 +120,7 @@
 
 // Tune the allocator's choice of memory tags to make it more likely that
 // a certain class of memory errors will be detected. The value argument should
-// be one of the enumerators of the scudo_memtag_tuning enum below.
+// be one of the M_MEMTAG_TUNING_* constants below.
 #ifndef M_MEMTAG_TUNING
 #define M_MEMTAG_TUNING -102
 #endif
@@ -145,13 +145,15 @@
 #define M_TSDS_COUNT_MAX -202
 #endif
 
-enum scudo_memtag_tuning {
-  // Tune for buffer overflows.
-  M_MEMTAG_TUNING_BUFFER_OVERFLOW,
+// Tune for buffer overflows.
+#ifndef M_MEMTAG_TUNING_BUFFER_OVERFLOW
+#define M_MEMTAG_TUNING_BUFFER_OVERFLOW 0
+#endif
 
-  // Tune for use-after-free.
-  M_MEMTAG_TUNING_UAF,
-};
+// Tune for use-after-free.
+#ifndef M_MEMTAG_TUNING_UAF
+#define M_MEMTAG_TUNING_UAF 1
+#endif
 
 } // extern "C"
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104758.353822.patch
Type: text/x-patch
Size: 1085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210622/bd83e1b6/attachment.bin>


More information about the llvm-commits mailing list