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

vbpf / ebpf-verifier / 12845504567

18 Jan 2025 04:08PM UTC coverage: 88.169% (-1.5%) from 89.646%
12845504567

push

github

web-flow
Handle upgrade from LCOV 1.15 to LCOV 2.0 (#826)

* Testing code coverage with a comment only change
* Workaround for failing code coverage
* Testing code coverage fix

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

8481 of 9619 relevant lines covered (88.17%)

7430805.79 hits per line

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

81.25
/src/program.hpp
1
// Copyright (c) Prevail Verifier contributors.
2
// SPDX-License-Identifier: MIT
3
#pragma once
4

5
#include <map>
6
#include <vector>
7

8
#include "crab/cfg.hpp"
9
#include "crab/label.hpp"
10
#include "crab_utils/debug.hpp"
11

12
#include "asm_syntax.hpp"
13

14
class Program {
15
    friend struct cfg_builder_t;
16

17
    std::map<label_t, Instruction> m_instructions{{label_t::entry, Undefined{}}, {label_t::exit, Undefined{}}};
18

19
    // This is a cache. The assertions can also be computed on the fly.
20
    std::map<label_t, std::vector<Assertion>> m_assertions{{label_t::entry, {}}, {label_t::exit, {}}};
21
    crab::cfg_t m_cfg;
22

23
    // TODO: add program_info field
24

25
  public:
26
    const crab::cfg_t& cfg() const { return m_cfg; }
321,955✔
27

28
    //! return a view of the labels, including entry and exit
29
    [[nodiscard]]
30
    auto labels() const {
2,480✔
31
        return m_cfg.labels();
2,480✔
32
    }
33

34
    const Instruction& instruction_at(const label_t& label) const {
254,582✔
35
        if (!m_instructions.contains(label)) {
254,582✔
36
            CRAB_ERROR("Label ", to_string(label), " not found in the CFG: ");
×
37
        }
38
        return m_instructions.at(label);
254,582✔
39
    }
40

41
    Instruction& instruction_at(const label_t& label) {
342,148✔
42
        if (!m_instructions.contains(label)) {
342,148✔
43
            CRAB_ERROR("Label ", to_string(label), " not found in the CFG: ");
×
44
        }
45
        return m_instructions.at(label);
342,148✔
46
    }
47

48
    std::vector<Assertion> assertions_at(const label_t& label) const {
141,578✔
49
        if (!m_assertions.contains(label)) {
141,578✔
50
            CRAB_ERROR("Label ", to_string(label), " not found in the CFG: ");
×
51
        }
52
        return m_assertions.at(label);
141,578✔
53
    }
54

55
    static Program from_sequence(const InstructionSeq& inst_seq, const program_info& info,
56
                                 const prepare_cfg_options& options);
57
};
58

59
class InvalidControlFlow final : public std::runtime_error {
60
  public:
61
    explicit InvalidControlFlow(const std::string& what) : std::runtime_error(what) {}
8✔
62
};
63

64
std::vector<Assertion> get_assertions(Instruction ins, const program_info& info, const std::optional<label_t>& label);
65

66
std::vector<std::string> stats_headers();
67
std::map<std::string, int> collect_stats(const Program& prog);
68

69
using printfunc = std::function<void(std::ostream&, const label_t& label)>;
70
void print_program(const Program& prog, std::ostream& os, bool simplify, const printfunc& prefunc,
71
                   const printfunc& postfunc);
72
void print_program(const Program& prog, std::ostream& os, bool simplify);
73
void print_dot(const Program& prog, const std::string& outfile);
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