-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack to disable programs containing pointer arithmetics.
We add an assertion to ssa_value_set. This should be used for competition mode only.
- Loading branch information
1 parent
ebba461
commit 6108ad3
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ Author: Daniel Kroening, [email protected] | |
\*******************************************************************/ | ||
|
||
// #define DEBUG | ||
#define COMPETITION | ||
|
||
#ifdef DEBUG | ||
#include <iostream> | ||
|
@@ -366,6 +367,11 @@ void ssa_value_domaint::assign_rhs_rec( | |
} | ||
else if(rhs.id()==ID_plus) | ||
{ | ||
#ifdef COMPETITION | ||
bool pointer=false; | ||
bool arithmetics=false; | ||
#endif | ||
|
||
forall_operands(it, rhs) | ||
{ | ||
if(it->type().id()==ID_pointer) | ||
|
@@ -375,8 +381,22 @@ void ssa_value_domaint::assign_rhs_rec( | |
pointer_offset=1; | ||
unsigned a=merge_alignment(integer2ulong(pointer_offset), alignment); | ||
assign_rhs_rec(dest, *it, ns, true, a); | ||
|
||
#ifdef COMPETITION | ||
pointer=true; | ||
#endif | ||
} | ||
else if(it->type().id()==ID_unsignedbv || it->type().id()==ID_signedbv) | ||
{ | ||
#ifdef COMPETITION | ||
arithmetics=true; | ||
#endif | ||
} | ||
} | ||
|
||
#ifdef COMPETITION | ||
assert(!(pointer && arithmetics)); | ||
#endif | ||
} | ||
else if(rhs.id()==ID_minus) | ||
{ | ||
|
@@ -388,6 +408,12 @@ void ssa_value_domaint::assign_rhs_rec( | |
pointer_offset=1; | ||
unsigned a=merge_alignment(integer2ulong(pointer_offset), alignment); | ||
assign_rhs_rec(dest, rhs.op0(), ns, true, a); | ||
|
||
#ifdef COMPETITION | ||
assert( | ||
!(rhs.op1().type().id()==ID_unsignedbv || | ||
rhs.op1().type().id()==ID_signedbv)); | ||
#endif | ||
} | ||
} | ||
else if(rhs.id()==ID_dereference) | ||
|