Skip to content

Commit d8a3696

Browse files
committed
This reverts part of commit b82e48d.
And fix V type in ::set.
1 parent 55f42e7 commit d8a3696

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clang/include/clang/Basic/Sanitizers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class SanitizerMaskCutoffs {
160160
public:
161161
std::optional<double> operator[](unsigned Kind) const;
162162

163-
void set(SanitizerMask K, float V);
163+
void set(SanitizerMask K, double V);
164164
void clear(SanitizerMask K = SanitizerKind::All);
165165
};
166166

clang/lib/Basic/Sanitizers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace clang;
2424

2525
static const double SanitizerMaskCutoffsEps = 0.000000001f;
2626

27-
void SanitizerMaskCutoffs::set(SanitizerMask K, float V) {
27+
void SanitizerMaskCutoffs::set(SanitizerMask K, double V) {
2828
if (V < SanitizerMaskCutoffsEps && Cutoffs.empty())
2929
return;
3030
for (unsigned int i = 0; i < SanitizerKind::SO_Count; i++)
@@ -38,7 +38,7 @@ std::optional<double> SanitizerMaskCutoffs::operator[](unsigned Kind) const {
3838
if (Cutoffs.empty() || Cutoffs[Kind] < SanitizerMaskCutoffsEps)
3939
return std::nullopt;
4040

41-
return Cutoffs[Kind];
41+
return Cutoffs[Kind];
4242
}
4343

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

clang/test/Driver/fsanitize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,11 +1173,11 @@
11731173

11741174
// Enable undefined, then cancel out integer using a cutoff of 0.0, then re-enable signed-integer-overflow
11751175
// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fno-sanitize-top-hot=undefined=0.5,integer=0.0,signed-integer-overflow=0.7 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT4
1176-
// CHECK-TOP-HOT4: "-fno-sanitize-top-hot={{((signed-integer-overflow|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function|vptr)=(0.5|0.49|0.7|0.69)([0-9]*),?){16}"}}
1176+
// CHECK-TOP-HOT4: "-fno-sanitize-top-hot={{((signed-integer-overflow|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function|vptr)=0.[57]0*,?){16}"}}
11771177

11781178
// Check that -fno-sanitize-top-hot=undefined=0.4 does not widen the set of -fsanitize=integer checks.
11791179
// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=integer -fno-sanitize-top-hot=undefined=0.4 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT5
1180-
// CHECK-TOP-HOT5: "-fno-sanitize-top-hot={{((integer-divide-by-zero|shift-base|shift-exponent|signed-integer-overflow)=(0.4|0.39)([0-9]*),?){4}"}}
1180+
// CHECK-TOP-HOT5: "-fno-sanitize-top-hot={{((integer-divide-by-zero|shift-base|shift-exponent|signed-integer-overflow)=0.40*,?){4}"}}
11811181

11821182
// No-op: it's allowed for the user to specify a cutoff of 0.0, though the argument is not passed along by the driver.
11831183
// RUN: %clang -Werror --target=x86_64-linux-gnu -fsanitize=undefined -fno-sanitize-top-hot=undefined=0.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TOP-HOT6

0 commit comments

Comments
 (0)