Commit ccd6f89
committed
coverage: Never emit improperly-ordered coverage regions
If we emit a coverage region that is improperly ordered (end < start),
`llvm-cov` will fail with `coveragemap_error::malformed`, which is inconvenient
for users and also very hard to debug.
Ideally we would fix the root causes of these situations, but they tend to
occur in very obscure edge-case scenarios (often involving nested macros), and
we don't always have a good MCVE to work from. So it makes sense to also have a
catch-all check that will prevent improperly-ordered regions from ever being
emitted.1 parent 5b49e17 commit ccd6f89
1 file changed
+21
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
296 | 310 | | |
297 | 311 | | |
298 | 312 | | |
| |||
0 commit comments