• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vbpf / prevail / 24833288113

23 Apr 2026 11:43AM UTC coverage: 89.067% (+0.03%) from 89.041%
24833288113

push

github

web-flow
Fix failure-slice filter losing total_stack_size; refactor printing API (#1094)

- `compute_slice_from_label` silently zeroed `RelevantState::total_stack_size` for every entry in `slice_labels` / `visited`. The field was added in #1088 to replace `thread_local_options`, but the `map[key]` + merge idiom produced default-constructed (`total=0`) entries that only had `registers` / `stack_offsets` copied into them. The filter then translated every relative stack offset against `total=0`, so `s[3912...3919]`-style constraints were filtered out of the printed slice unless a relevant register also appeared in them. Reproduces on `ebpf-samples/cilium-core/bpf_lxc.o tc/tail tail_handle_ipv6 --failure-slice`.
- **Fix by construction** rather than by patching propagation. `RelevantState` now:
  - owns just the analysis-wide data it needs (today: `int total_stack_size`),
  - has a single `explicit RelevantState(const AnalysisContext&)` constructor,
  - has no default constructor, so `map[key]` no longer compiles — the class of bug is closed.
  - Callers pass an `AnalysisContext`; nobody has to know which field the filter reads.
- **Refactors** along for the ride:
  - `RelevantState::merge()` / `size()` as methods, replacing four copies of `registers.insert + stack_offsets.insert` + size bookkeeping.
  - `print_program` / `print_invariants` / `print_error` / `print_invariants_filtered` / `print_failure_slices` now take a single `const verbosity_options_t&` instead of a variable tail of `bool simplify, bool compact, bool print_line_info`. `compact` moved to `verbosity_options_t::compact_slice`.
  - `invariant_filter` converted from a stream manipulator (`os << invariant_filter(&state); ... os << invariant_filter(nullptr);`) into a scoped RAII guard: `invariant_filter guard(os, &state);`. Five manual set/clear pairs collapse to five scoped locals, and the filter state is recovered on exception.

---------

Signed-off-by: Elazar Gershuni <elazarg@gmail.com>
Co-author... (continued)

40 of 69 new or added lines in 4 files covered. (57.97%)

13426 of 15074 relevant lines covered (89.07%)

4476164.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.97
/src/result.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc