Skip to content

Avoid spurious signed/unsigned comparison warnings #1205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/symex/path_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ bool path_searcht::drop_state(const statet &state)
}

// depth limit
if(depth_limit>=0 && state.get_depth()>depth_limit)
if(state.get_depth()>=depth_limit)
return true;

// context bound
if(context_bound>=0 && state.get_no_thread_interleavings()>context_bound)
if(state.get_no_thread_interleavings()>=context_bound)
return true;

// branch bound
if(branch_bound>=0 && state.get_no_branches()>branch_bound)
if(state.get_no_branches()>=branch_bound)
return true;

// unwinding limit -- loops
Expand All @@ -298,7 +298,7 @@ bool path_searcht::drop_state(const statet &state)
bool stop=false;

for(const auto &loop_info : state.unwinding_map)
if(loop_info.second>unwind_limit)
if(loop_info.second>=unwind_limit)
{
stop=true;
break;
Expand All @@ -324,7 +324,7 @@ bool path_searcht::drop_state(const statet &state)
bool stop=false;

for(const auto &rec_info : state.recursion_map)
if(rec_info.second>unwind_limit)
if(rec_info.second>=unwind_limit)
{
stop=true;
break;
Expand Down
22 changes: 12 additions & 10 deletions src/symex/path_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ Author: Daniel Kroening, [email protected]

#include <path-symex/path_symex_state.h>

#include <limits>

class path_searcht:public safety_checkert
{
public:
explicit path_searcht(const namespacet &_ns):
safety_checkert(_ns),
show_vcc(false),
eager_infeasibility(false),
depth_limit(-1), // no limit
context_bound(-1),
branch_bound(-1),
unwind_limit(-1),
time_limit(-1),
depth_limit(std::numeric_limits<unsigned>::max()),
context_bound(std::numeric_limits<unsigned>::max()),
branch_bound(std::numeric_limits<unsigned>::max()),
unwind_limit(std::numeric_limits<unsigned>::max()),
time_limit(std::numeric_limits<unsigned>::max()),
search_heuristic(search_heuristict::DFS)
{
}
Expand Down Expand Up @@ -132,11 +134,11 @@ class path_searcht:public safety_checkert
void initialize_property_map(
const goto_functionst &goto_functions);

int depth_limit;
int context_bound;
int branch_bound;
int unwind_limit;
int time_limit;
unsigned depth_limit;
unsigned context_bound;
unsigned branch_bound;
unsigned unwind_limit;
unsigned time_limit;

enum class search_heuristict { DFS, BFS, LOCS } search_heuristic;

Expand Down