Commit 5e27cb1
committed
[ubsan] Assert that each check only has one SanitizerKind
The `Checked` parameter of `CodeGenFunction::EmitCheck` is of type `ArrayRef<std::pair<llvm::Value *, SanitizerMask>>`. In the general case, SanitizerMask can denote that zero or more sanitizers are enabled, but I believe (from tests and inspecting the code) that `EmitCheck` assumes exactly one sanitizer enabled per SanitizerMask. This patch adds an assertion for this invariant.
This is not intended to change the functionality of the code, but will
make it easier for maintainers to reason about and extend the
`EmitCheck` function.1 parent ba704d5 commit 5e27cb1
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
| 3606 | + | |
| 3607 | + | |
3606 | 3608 | | |
3607 | 3609 | | |
3608 | 3610 | | |
| |||
0 commit comments