[PATCH] D103176: [dfsan] Add a flag about whether to propagate offset labels at gep

George Balatsouras via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 15:17:01 PDT 2021


gbalats added inline comments.


================
Comment at: compiler-rt/test/dfsan/gep.c:15
+  dfsan_set_label(1, &i, sizeof(i));
+  dfsan_set_label(0, &p, sizeof(p));
+  p = p + i;
----------------
Why is this needed?


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:190
+enum PropagationPolicy {
+  DontCombinePointerLabelsOnLoad,
+  CombinePointerLabelsOnStore,
----------------
Why do we need the negated condition and not have CombinePointerLabelsOnLoad instead? Same for other options.
We should be able to set a default value that doesn't have to be the 0 bitmask.


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:196
+
+cl::bits<PropagationPolicy> PropagationPolicyBits(
+    cl::desc("Label Propagation Policies:"),
----------------
Out of curiosity, is there any benefit other in logically grouping these together when using cl::bits vs having individual options?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103176



More information about the llvm-commits mailing list