[PATCH] Implement nonnull-attribute sanitizer

Alexey Samsonov vonosmas at gmail.com
Thu Aug 28 10:59:37 PDT 2014


================
Comment at: tools/clang/lib/CodeGen/CGCall.cpp:2425
@@ +2424,3 @@
+      CGF.EmitCheckSourceLocation(FD->getLocation())};
+  llvm::Value *DynamicData[] = {llvm::ConstantInt::get(CGF.Int32Ty, ArgNo + 1)};
+  CGF.EmitCheck(Cond, "nonnull_arg", StaticData, DynamicData,
----------------
rsmith wrote:
> Is there a reason to pass `ArgNo` as dynamic data rather than static?
Right, we can move it to static data now, as we now discriminate checks for different call arguments by source location anyway. Done.

http://reviews.llvm.org/D5082






More information about the cfe-commits mailing list