diff options
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp | 5 | ||||
-rw-r--r-- | llvm/test/Instrumentation/DataFlowSanitizer/arith.ll | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp index a5776a47af7..2279c1bcb6a 100644 --- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -437,6 +437,7 @@ public: } void visitOperandShadowInst(Instruction &I); + void visitUnaryOperator(UnaryOperator &UO); void visitBinaryOperator(BinaryOperator &BO); void visitCastInst(CastInst &CI); void visitCmpInst(CmpInst &CI); @@ -1398,6 +1399,10 @@ void DFSanVisitor::visitStoreInst(StoreInst &SI) { DFSF.storeShadow(SI.getPointerOperand(), Size, Align, Shadow, &SI); } +void DFSanVisitor::visitUnaryOperator(UnaryOperator &UO) { + visitOperandShadowInst(UO); +} + void DFSanVisitor::visitBinaryOperator(BinaryOperator &BO) { visitOperandShadowInst(BO); } diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll b/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll index db33e452083..3ea78552e4f 100644 --- a/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll @@ -62,3 +62,13 @@ define i8 @udiv(i8 %a, i8 %b) { %c = udiv i8 %a, %b ret i8 %c } + +define double @fneg(double %a) { + ; CHECK: @"dfs$fneg" + ; CHECK: load{{.*}}__dfsan_arg_tls + ; CHECK: fneg double + ; CHECK: store{{.*}}__dfsan_retval_tls + ; CHECK: ret double + %c = fneg double %a + ret double %c +} |