Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Nov 5, 2024
1 parent 5390b2b commit 77f3dc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/crab/cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ class cfg_t final {

private:
basic_block_map_t m_blocks;
std::optional<std::vector<label_t>> m_potential_loop_headers;

using visited_t = std::set<label_t>;

Expand Down
10 changes: 5 additions & 5 deletions src/crab/fwd_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ std::pair<invariant_table_t, invariant_table_t> run_forward_analyzer(const cfg_t
if (thread_local_options.check_termination) {
// For every potential loop header, initialize the loop counter to 0.
for (const auto& label : cfg.potential_loop_headers()) {
// The initial path adds labels in the form of (from, to) where
// where from is the PC and to is -1. When the CFG is expanded to be non-deterministic
// branches with actual to labels are added, but these will not have loop counters as
// loop counters are only added to the deterministic cfg.
// Ignore labels added by the non-deterministic expansion.
// See prepare_cfg() in src/asm_cfg.cpp.
// It adds IncrementLoopCounter to blocks that are possible loops, but only
// on the first pass, where all labels are in the form from::-1. After the cfg is converted to its
// non-deterministic form there will be additional labels in the form of from::to where to will be != -1.
// Only initialize the loop counter for the original labels.
if (label.to != -1) {
continue;
}
Expand Down

0 comments on commit 77f3dc9

Please sign in to comment.