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

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 16:31:28 PDT 2021


stephan.yichao.zhao added inline comments.


================
Comment at: compiler-rt/test/dfsan/gep.c:16
+  p = p + i;
+#ifdef PROP_OFFSET_LABELS
+  assert(dfsan_get_label(p) == 1);
----------------
gbalats wrote:
> You could remove the need for macros by just printing the result of dfsan_get_label and using different CHECK prefixes for the two run invocations above.
Most other cases use assert to check labels. So this is consistent with others.


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:2794-2796
+  DFSF.setShadow(&GEPI, DFSF.getShadow(GEPI.getOperand(0)));
+  if (DFSF.DFS.shouldTrackOrigins())
+    DFSF.setOrigin(&GEPI, DFSF.getOrigin(GEPI.getOperand(0)));
----------------
gbalats wrote:
> Use getPointerOperand instead and extract to variable.
Thank you.


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