================
@@ -177,7 +177,8 @@ BugReportPtr BitwiseShiftValidator::checkOvershift() {
     RightOpStr = formatv(" '{0}'", ConcreteRight->getValue());
   else {
     SValBuilder &SVB = Ctx.getSValBuilder();
-    if (const llvm::APSInt *MinRight = SVB.getMinValue(FoldedState, Right)) {
+    if (const llvm::APSInt *MinRight = SVB.getMinValue(FoldedState, Right);
+        MinRight && *MinRight >= LHSBitWidth) {
----------------
NagyDonat wrote:

It's nice that this `APSInt >= unsigned` comparison works out of the box :smile:

Are you sure that it doesn't cause weird crashes? (`APSInt` is infamous for 
aggressive assertions on signed vs unsigned comparisons.)

https://github.com/llvm/llvm-project/pull/112583
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to