devnexen added inline comments.
================
Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:1560-1566
         // If the size is known to be zero, we're done.
         if (StateZeroSize && !StateNonZeroSize) {
           StateZeroSize = StateZeroSize->BindExpr(CE, LCtx, DstVal);
           C.addTransition(StateZeroSize);
           return;
         }
 
----------------
NoQ wrote:
> One more cornercase where the return value needs to be corrected. It'd be 
> great to de-duplicate this code to avoid similar problems in the future.
> 
> Test case:
> ```
> int foo(char *dst, const char *src) {
>   return strlcpy(dst, src, 0); // no-crash
> }
> ```
Thanks for the hint ! will do a separate "PR".


Repository:
  rC Clang

https://reviews.llvm.org/D45177



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to