[PATCH] D139543: [DFSan] Add callback that allows to track which function tainted data reaches
clg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 14:26:13 PST 2022
clg added inline comments.
================
Comment at: compiler-rt/test/dfsan/reaches_function.c:52
+int main(int argc, char *argv[]) {
+ // CHECK: {{.*}}compiler-rt/test/dfsan/reaches_function.c:[[# @LINE - 1]] main
+
----------------
browneee wrote:
> To clarify, this is triggered by the tainted value is returned from add?
>
> Should we expect the location to be here-1 because it should be the line number of the containing function, or should the line number be down at 60?
changed it, see other comment.
================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1062-1066
+ CILine = llvm::ConstantInt::get(
+ I.getContext(),
+ llvm::APInt(32, dbgloc.getFnDebugLoc().getLine(), false));
+ FilePathPtr =
+ IRB.CreateGlobalStringPtr(dbgloc.getFnDebugLoc()->getFilename());
----------------
browneee wrote:
> Should this attempt to use debug information from `Instruction &I` (the instruction where this occurs), rather than just using the debug loc for the containing function?
Sure, we might as well give more fine-grained information on where the access took place.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139543/new/
https://reviews.llvm.org/D139543
More information about the llvm-commits
mailing list