xazax.hun added a comment.

Overall looks good to me, one comment inline. I think it is good to have these 
checks to prevent the analyzer executing undefined behavior. Maybe this would 
make it more feasible to run the analyzer with ubsan :)
In the future, it would be great to also look for these cases symbolically, but 
I believe it is perfectly fine to have that in a separate patch.



================
Comment at: lib/StaticAnalyzer/Core/BasicValueFactory.cpp:238
 
+      if (V1.isSigned() && (unsigned) Amt > V1.countLeadingZeros())
+          return nullptr;
----------------
Do you get a warning if you remove the cast above? I am not sure that we 
actually want to have the cast here.


https://reviews.llvm.org/D41816



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

Reply via email to