Skip to content

Commit c362e66

Browse files
committed
Address feedback: add assert and enforce AlwaysIn
1 parent 9afe716 commit c362e66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ parseSanitizeArgs(const Driver &D, const llvm::opt::ArgList &Args,
258258
bool DiagnoseErrors, SanitizerMask Default,
259259
SanitizerMask AlwaysIn, SanitizerMask AlwaysOut, int OptInID,
260260
int OptOutID) {
261+
assert(!(AlwaysIn & AlwaysOut) &&
262+
"parseSanitizeArgs called with contradictory in/out requirements");
261263

262-
SanitizerMask Output = Default | AlwaysIn;
264+
SanitizerMask Output = Default;
263265
// Keep track of which violations we have already reported, to avoid
264266
// duplicate error messages.
265267
SanitizerMask DiagnosedAlwaysInViolations;
@@ -300,6 +302,7 @@ parseSanitizeArgs(const Driver &D, const llvm::opt::ArgList &Args,
300302
}
301303
}
302304

305+
Output |= AlwaysIn;
303306
Output &= ~AlwaysOut;
304307

305308
return Output;

0 commit comments

Comments
 (0)