Skip to content

Commit e52a02a

Browse files
committed
Disable unsupported operations in competition mode
For now, we disable memcpy as it is implemented via a CBMC built-in operation that we do not support in 2LS, yet.
1 parent 371cb09 commit e52a02a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/ssa/local_ssa.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ void local_SSAt::build_SSA()
5151
build_function_call(i_it);
5252
// build_unknown_objs(i_it);
5353
collect_record_frees(i_it);
54+
55+
if (options.get_bool_option("competition-mode"))
56+
disable_unsupported_instructions(i_it);
5457
}
5558

5659
// collect custom templates in loop heads
@@ -1644,3 +1647,13 @@ bool local_SSAt::can_reuse_symderef(
16441647

16451648
return true;
16461649
}
1650+
1651+
void local_SSAt::disable_unsupported_instructions(locationt loc)
1652+
{
1653+
if (loc->is_other())
1654+
{
1655+
auto st = loc->get_code().get_statement();
1656+
if(st=="array_copy" || st=="array_replace")
1657+
assert(false);
1658+
}
1659+
}

src/ssa/local_ssa.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ class local_SSAt
271271
void build_assertions(locationt loc);
272272
void build_unknown_objs(locationt loc);
273273

274+
// competition-mode specific checks
275+
void disable_unsupported_instructions(locationt loc);
276+
274277
void collect_allocation_guards(const code_assignt &assign, locationt loc);
275278
void get_alloc_guard_rec(const exprt &expr, exprt old_guard);
276279
void collect_record_frees(locationt loc);

0 commit comments

Comments
 (0)