Skip to content

Commit aa99900

Browse files
Merge pull request #470 from smowton/fix_address_space_size_check
Fix address space size check
2 parents 2affe99 + dc0b1fa commit aa99900

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#include <stdlib.h>
3+
#include <assert.h>
4+
5+
int main(int argc, char** argv)
6+
{
7+
8+
int i;
9+
char* c;
10+
for(i=0; i<300; ++i)
11+
{
12+
c=(char*)malloc(1);
13+
assert(c!=(char*)0);
14+
}
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CORE
2+
test.c
3+
--no-simplify --unwind 300
4+
too many variables
5+
--

src/solvers/flattening/bv_pointers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ void bv_pointerst::add_addr(const exprt &expr, bvt &bv)
795795
{
796796
std::size_t a=pointer_logic.add_object(expr);
797797

798-
if(a==(std::size_t(1)>>object_bits))
798+
if(a==(std::size_t(1)<<object_bits))
799799
throw "too many variables";
800800

801801
encode(a, bv);

0 commit comments

Comments
 (0)