Skip to content

Commit 6de4399

Browse files
committed
address coderabbit's comments
* test realistic forward loop started giving meta_offset=[-4098, 0] instead of meta_offset=[-oo, 0], which looks like a fixed bug Signed-off-by: Elazar Gershuni <[email protected]>
1 parent 9c5c9bc commit 6de4399

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/crab/var_registry.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ Variable VariableRegistry::cell_var(const DataKind array, const Number& offset,
172172
// Given a type variable, get the associated variable of a given kind.
173173
Variable VariableRegistry::kind_var(const DataKind kind, const Variable type_variable) {
174174
const std::string name = VariableRegistry::name(type_variable);
175-
return make(name.substr(0, name.rfind('.') + 1) + name_of(kind));
175+
const auto dot_pos = name.rfind('.');
176+
if (dot_pos == std::string::npos) {
177+
CRAB_ERROR("Variable name '", name, "' does not contain a dot");
178+
}
179+
return make(name.substr(0, dot_pos + 1) + name_of(kind));
176180
}
177181

178182
Variable VariableRegistry::meta_offset() { return make("meta_offset"); }

src/crab_utils/stats.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
#include "stats.hpp"
44

5+
#include <algorithm>
56
#include <iostream>
67
#include <optional>
78
#ifdef _WIN32

src/crab_utils/stats.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <map>
66
#include <string>
77

8-
#include "arith/variable.hpp"
98
#include "crab_utils/lazy_allocator.hpp"
109

1110
namespace prevail {

src/string_constraints.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include <optional>
67
#include <regex>
78
#include <set>
89
#include <string>

0 commit comments

Comments
 (0)