[PATCH] D46752: [Analysis] Validate the return type of s(n)printf libcalls

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 08:11:54 PDT 2018


mstorsjo added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:696
+            FTy.getParamType(1)->isPointerTy() &&
+            FTy.getReturnType()->isIntegerTy());
   case LibFunc_snprintf:
----------------
mstorsjo wrote:
> spatel wrote:
> > Is it possible to make this check stronger:
> > FTy.getReturnType()->isIntegerTy(32) ?
> I guess that'd be ok as well, although it would disqualify any ILP64 platform. But I guess that's just a theoretical concern, given the number of ILP64 platforms.
I see that other existing checks for things that should be `int` also uses `isIntegerTy(32)`, so I changed it as requested.


https://reviews.llvm.org/D46752





More information about the llvm-commits mailing list