about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-05-29 16:16:45 +1000
committerZalathar <Zalathar@users.noreply.github.com>2024-05-29 20:04:27 +1000
commit7845c6e09ca2b9fec6494bbfd5ca3e8af257314b (patch)
tree6a1090e9b2d42e675f13081921dc527b1b094043 /compiler/rustc_codegen_llvm/src
parentda159eb331b27df528185c616b394bb0e1d2a4bd (diff)
downloadrust-7845c6e09ca2b9fec6494bbfd5ca3e8af257314b.tar.gz
rust-7845c6e09ca2b9fec6494bbfd5ca3e8af257314b.zip
coverage: Avoid overflow when the MC/DC condition limit is exceeded
If we perform this subtraction and then add 1, the subtraction can sometimes
overflow to -1 before the addition can bring its value back to 0. That
behaviour seems to be benign, but it nevertheless causes test failures in
compiler configurations that check for overflow.

We can avoid the overflow by instead subtracting (N - 1), which is
algebraically equivalent, and more closely matches what the code is actually
trying to do.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions