================ @@ -1986,10 +2013,15 @@ bool CodeGenFunction::EmitScalarRangeCheck(llvm::Value *Value, QualType Ty, getContext().isTypeIgnoredBySanitizer(SanitizerKind::Enum, Ty)) return false; - llvm::APInt Min, End; - if (!getRangeForType(*this, Ty, Min, End, /*StrictEnums=*/true, IsBool)) + const std::optional<llvm::ConstantRange> Range = getRangeForType( + Ty, getContext().getTypeSize(Ty), /*ForceStrictEnums=*/true, + /*AssumeBooleanRepresentation*/ IsBool); ---------------- keinflue wrote:
Nevermind, I should have checked the blame for the line first: https://github.com/llvm/llvm-project/commit/4593a46cd92ab88e9651ae75f6c623851c353964: > On some Apple platforms, the ObjC BOOL type is defined as a signed char. When performing instrumentation for -fsanitize=bool, we'd like to treat the range of BOOL like it's always {0, 1}. While we can't change clang's IRGen for char-backed BOOL's due to ABI compatibility concerns, we can teach ubsan to catch potential abuses of this type. https://github.com/llvm/llvm-project/pull/154807 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits