Skip to content

Commit acc3a7e

Browse files
authored
Update Sanitizers.cpp
1 parent afacf0e commit acc3a7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Basic/Sanitizers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ std::optional<double> SanitizerMaskCutoffs::operator[](unsigned Kind) const {
4444

4545
void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); }
4646

47-
std::optional<std::vector<int>>
48-
SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const {
47+
std::optional<std::vector<unsigned>>
48+
SanitizerMaskCutoffs::getAllScaled(unsigned ScalingFactor) const {
4949
std::vector<int> ScaledCutoffs;
5050

5151
bool AnyCutoff = false;
5252
for (unsigned int i = 0; i < SanitizerKind::SO_Count; ++i) {
5353
auto C = (*this)[i];
54-
ScaledCutoffs.push_back(C.has_value() ? lround(ScalingFactor * *C) : 0);
54+
ScaledCutoffs.push_back(C.has_value() ? lround(std::clamp(ScalingFactor, 0.0, 1.0) * *C) : 0);
5555
AnyCutoff |= C.has_value();
5656
}
5757

0 commit comments

Comments
 (0)