================ @@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; - if (ZeroIsUndefined && !Val) - return Error(E); + if (!Val) { ---------------- overmighty wrote:
`!Val` checks if the first argument is zero: https://github.com/llvm/llvm-project/blob/59bb4f259d78c7a1916462a1f6d12cf335523db1/llvm/include/llvm/ADT/APInt.h#L587 We always need to evaluate the first argument and check if it's zero, as the second argument is a fallback return value that's only used in that case. https://github.com/llvm/llvm-project/pull/86577 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits