Skip to content
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

Merge master into test-gen-support #1267

Merged
merged 82 commits into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9740142
Handle array initialization with a non-array gracefully
tautschnig Jun 20, 2016
26e8fec
Documentation for goto_program_templatet and cfg_baset
cesaro Jul 13, 2017
564f64c
added a non-recursive variant of APPLY
Jul 15, 2017
a71ca41
disable linter for assertions
Jul 20, 2017
d078dd8
Support out-of-bounds checks on arrays of dynamic size
tautschnig Jul 20, 2017
4448258
test.pl - go through all child directories
Aug 1, 2017
6eef691
More complete modelling of fgets
tautschnig Jul 22, 2017
f691135
Import getopt{,_long} and vasprintf models from SV-COMP/busybox
tautschnig Jul 22, 2017
151efbc
Merge pull request #131 from tautschnig/struct-init-error
Aug 3, 2017
eb96b70
increased version number in preparation for release 5.8
Aug 3, 2017
8e70eaa
Merge pull request #1144 from diffblue/miniBDD-non-recursive-apply
Aug 3, 2017
439ef97
fix for operator< on reverse_keyt in miniBDD, fixing segfault in ebmc
Jun 26, 2017
393256f
invariant_violated does not return
Aug 3, 2017
ff945b3
test for miniBDD
Jul 23, 2017
879a47b
Symex support for lhs-typecasts and side effects
tautschnig Jun 26, 2016
08f1a9e
Extract elements of array, struct directly instead of simplifying
tautschnig Jun 26, 2016
f281f88
Removed redundant get_pc() (there is pc())
tautschnig Jun 26, 2016
52db9e4
Fix symex thread statistics
tautschnig Jun 26, 2016
c69a21b
Extended symex progres statistics
tautschnig Jun 26, 2016
acdc797
Symex: output instruction processing and loop unwinding like CBMC
tautschnig Jun 26, 2016
260e03d
symex --max-search-time limit and cleanup
tautschnig Jun 26, 2016
73adfb0
Perform function-pointer removal in symex
tautschnig Apr 19, 2017
e2ed0df
Avoid using integer_typet where unsuitable
tautschnig Jun 19, 2017
0cad6f4
Merge pull request #1062 from diffblue/fix_for_miniBDD
Aug 4, 2017
ea476f7
Merge pull request #151 from tautschnig/symex-improvements
Aug 4, 2017
df81a9c
Merge pull request #1167 from tautschnig/c-library-ext
Aug 4, 2017
bb9cef3
Merge pull request #1035 from tautschnig/no_integer_typet
Aug 4, 2017
a3578c0
Avoid spurious signed/unsigned comparison warnings
tautschnig Aug 4, 2017
652ea09
Merge pull request #1205 from tautschnig/sign-compare-fix
Aug 4, 2017
76ae912
Merge pull request #1158 from tautschnig/array-bounds
Aug 4, 2017
de40333
fix vacuous conjuncts
Aug 4, 2017
548aeba
Stop using C headers
reuk Aug 4, 2017
33811ce
Update coding standard
reuk Aug 4, 2017
2f55076
Enable extractbits over arbitrary types, fix byte extract omission
tautschnig Aug 4, 2017
9d3a99e
Merge pull request #1211 from tautschnig/fix-1209
Aug 4, 2017
4dd5405
Merge pull request #1210 from reuk/stop-using-c-headers
Aug 5, 2017
b59d0c7
Merge pull request #1188 from LAJW/any-desc
tautschnig Aug 7, 2017
f97c169
Merge pull request #1132 from cesaro/feature/documentation
tautschnig Aug 8, 2017
2db41da
remove dead comparison in simplifier
Aug 9, 2017
00ead5b
Merge branch 'master' of github.com:diffblue/cbmc
Aug 9, 2017
d1a7403
support clang's __builtin_flt_rounds
Aug 9, 2017
60906b1
simplifier: erase 'all ones' out of bitand
Aug 9, 2017
517e69f
silence linter on builtin headers
Aug 10, 2017
51cc77b
Merge pull request #1225 from diffblue/builtin_flt_rounds
tautschnig Aug 10, 2017
e0a6bbd
Merge pull request #1226 from diffblue/simplify_bitand_all_ones
tautschnig Aug 10, 2017
240ae60
tests from Dan
Aug 10, 2017
4d1c26e
Add merge driver
reuk Aug 11, 2017
0346dcd
Merge pull request #1232 from reuk/reuk/add-merge-driver
Aug 11, 2017
875377a
make test less specific
Aug 11, 2017
f2eff9d
source location of the generated 'default' label is now the end of th…
Aug 11, 2017
a17dc61
remove an old file
Aug 14, 2017
6870bb6
add a location node for switch statements
Aug 14, 2017
04804df
Merge pull request #1234 from diffblue/switch_end_location
Aug 14, 2017
ac97e13
stronger typing of parameters
Aug 15, 2017
c531a0c
a missing 'const'
Aug 15, 2017
c16e8c2
move include
Aug 15, 2017
9ea407b
Deactivate unreachable code
peterschrammel Jul 28, 2017
5f1eda8
Remove unreachable code
peterschrammel Jul 28, 2017
e545f98
Fix class member initialization...
peterschrammel Jul 28, 2017
4fc0edd
Comment on uninitialized class members
peterschrammel Jul 28, 2017
f0b1e36
Removed unused class member
peterschrammel Jul 28, 2017
8a0391d
Comment regarding illegal iterator increment
peterschrammel Jul 28, 2017
e74c000
Ignore return value
peterschrammel Jul 28, 2017
a8c640a
Make truncation explicit
peterschrammel Jul 28, 2017
403f1e4
Use ID_C
peterschrammel Aug 8, 2017
a057ef5
ensure initialization of PODs
Aug 16, 2017
5919c5f
Fix accesses to erased elements
peterschrammel Jul 28, 2017
d580773
Deactivate unused declaration
peterschrammel Jul 28, 2017
fdb5734
Remove comparison without effect
peterschrammel Jul 28, 2017
22b919f
Whitespace cleanup
peterschrammel Aug 7, 2017
5ab5f3c
Fix uninitialized class members
peterschrammel Jul 28, 2017
ec6a400
Clean up initialization and unused constructors
peterschrammel Jul 28, 2017
2655d98
Check return values of remove, rename and stat
peterschrammel Jul 28, 2017
6440fc2
Replace asserts
peterschrammel Aug 7, 2017
de3ad89
Test passes
tautschnig Aug 20, 2017
1ab944e
Merge the correct attribute node
tautschnig Aug 20, 2017
b90c4a3
Merge pull request #1256 from tautschnig/c-attributes-fix
Aug 20, 2017
9623503
new goto_convert API
Aug 20, 2017
48c5b10
clean out langapi/languages.h
Aug 21, 2017
f17b637
Merge master into tgs
reuk Aug 22, 2017
bb88fd2
Add author string to version.h
reuk Aug 22, 2017
1b20f98
Remove trailing white space
reuk Aug 22, 2017
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
3 changes: 3 additions & 0 deletions CODING_STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ Here a few minimalistic coding rules for the CPROVER source tree.
include in the source file. For example, given `foo.h` and `foo.cpp`, the
line `#include "foo.h"` should precede all other include statements in
`foo.cpp`.
- Use the C++ versions of C headers (e.g. `cmath` instead of `math.h`).
Some of the C headers use macros instead of functions which can have
unexpected consequences.

# Makefiles
- Each source file should appear on a separate line
Expand Down
10 changes: 8 additions & 2 deletions regression/ansi-c/Struct_Initialization1/main.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#define STATIC_ASSERT(condition) \
int some_array##__LINE__[(condition) ? 1 : -1]

struct A {
int x;
int y;
};

struct _classinfo {
char a;
struct A s;
int *interfaces[];
};

struct _classinfo nullclass1 = { 42, 0, 0 };
struct _classinfo nullclass2 = { 42, { 0, 0 } };
struct _classinfo nullclass1 = { 42, 1, 2, 3, 4 };
struct _classinfo nullclass2 = { 42, { 1, 2 }, { 3, 4 } };

STATIC_ASSERT(sizeof(nullclass1)==sizeof(struct _classinfo));
STATIC_ASSERT(sizeof(nullclass2)==sizeof(struct _classinfo));
Expand Down
2 changes: 1 addition & 1 deletion regression/ansi-c/Struct_Initialization1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.c

^EXIT=0$
Expand Down
24 changes: 24 additions & 0 deletions regression/ansi-c/Struct_Initialization2/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#define STATIC_ASSERT(condition) \
int some_array##__LINE__[(condition) ? 1 : -1]

struct A {
int x;
int y;
int arr[];
};

struct _classinfo {
char a;
struct A s;
int *interfaces[];
};

struct _classinfo nullclass1 = { 42, 1, 2, 0, 3, 4 };
struct _classinfo nullclass2 = { 42, { 1, 2, 0 }, { 3, 4 } };

STATIC_ASSERT(sizeof(nullclass1)==sizeof(struct _classinfo));
STATIC_ASSERT(sizeof(nullclass2)==sizeof(struct _classinfo));

int main()
{
}
10 changes: 10 additions & 0 deletions regression/ansi-c/Struct_Initialization2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
main.c

^EXIT=(64|1)$
^SIGNAL=0$
^CONVERSION ERROR$
--
^warning: ignoring
--
variable-length arrays in the middle of a struct are not permitted
19 changes: 19 additions & 0 deletions regression/ansi-c/gcc_attributes10/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#define STATIC_ASSERT(condition) \
int array##__LINE__[(condition) ? 1 : -1]

#ifdef __GNUC__

int x __attribute__ ((__vector_size__ (12), __may_alias__));
int x2 __attribute__ ((__may_alias__));
int x3 __attribute__ ((__may_alias__, __vector_size__ (12)));

STATIC_ASSERT(sizeof(x)==12);
STATIC_ASSERT(sizeof(x2)==sizeof(int));
STATIC_ASSERT(sizeof(x3)==12);

#endif

int main(int argc, char* argv[])
{
return 0;
}
8 changes: 8 additions & 0 deletions regression/ansi-c/gcc_attributes10/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
2 changes: 1 addition & 1 deletion regression/ansi-c/gcc_attributes5/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KNOWNBUG
CORE
main.c

^EXIT=0$
Expand Down
12 changes: 12 additions & 0 deletions regression/ansi-c/sizeof4/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

#define STATIC_ASSERT(condition) \
int some_array##__LINE__[(condition) ? 1 : -1];

// The result of boolean operators is always an int
STATIC_ASSERT(sizeof(1.0 && 1.0)==sizeof(int));
STATIC_ASSERT(sizeof(1.0 || 1.0)==sizeof(int));
STATIC_ASSERT(sizeof(!1.0)==sizeof(int));

int main()
{
}
8 changes: 8 additions & 0 deletions regression/ansi-c/sizeof4/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
31 changes: 31 additions & 0 deletions regression/cbmc/Float-Rounding3/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This is C99, but currently only works with clang.
// gcc and Visual Studio appear to hard-wire FLT_ROUNDS to 1.

#ifdef __clang__

#include <assert.h>
#include <fenv.h>
#include <float.h>

int main()
{
fesetround(FE_DOWNWARD);
assert(FLT_ROUNDS==3);

fesetround(FE_TONEAREST);
assert(FLT_ROUNDS==1);

fesetround(FE_TOWARDZERO);
assert(FLT_ROUNDS==0);

fesetround(FE_UPWARD);
assert(FLT_ROUNDS==2);
}

#else

int main()
{
}

#endif
8 changes: 8 additions & 0 deletions regression/cbmc/Float-Rounding3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
14 changes: 14 additions & 0 deletions regression/cbmc/dynamic_size1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdlib.h>

int main()
{
unsigned x;

int *A=malloc(x*sizeof(int));

char *p=&A[1];

char c=*p;

return c;
}
9 changes: 9 additions & 0 deletions regression/cbmc/dynamic_size1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
main.c
--pointer-check
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
^unknown or invalid type size:
19 changes: 19 additions & 0 deletions regression/cbmc/enum6/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <assert.h>

int main(void)
{
enum A { zero, one, two, three } a = two, b = one, c = three;

a <<= b;
assert(a==4);

c += b;
assert(c==4);

enum E { fortytwo=42 } e = fortytwo;
double res;
res = -42.0 + (double) e;
assert ((res >= -0.000005) && (res <= 0.000005));

return 0;
}
8 changes: 8 additions & 0 deletions regression/cbmc/enum6/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
22 changes: 22 additions & 0 deletions regression/cbmc/fgets1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>
#include <assert.h>

int main()
{
char buffer[3]={'a', 'b', '\0'};
FILE *f=fdopen(0, "r");
if(!f)
return 1;

char *p=fgets(buffer, 3, f);
if(p)
{
assert(buffer[1]==p[1]);
assert(buffer[2]=='\0');
assert(p[1]=='b'); // expected to fail
}

fclose(f);

return 0;
}
10 changes: 10 additions & 0 deletions regression/cbmc/fgets1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
main.c
--bounds-check --pointer-check
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
\[main.assertion.3\] assertion p\[1\]=='b': FAILURE
\*\* 1 of \d+ failed \(2 iterations\)
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/cbmc/memory_allocation1/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ main.c
^SIGNAL=0$
\[main.pointer_dereference.2\] dereference failure: pointer invalid in \*p: SUCCESS
\[main.assertion.1\] assertion \*p==42: SUCCESS
\[main.pointer_dereference.14\] dereference failure: pointer invalid in p\[\(signed( long)? long int\)1\]: FAILURE
\[main.pointer_dereference.14\] dereference failure: pointer invalid in p\[.*1\]: FAILURE
\[main.assertion.2\] assertion \*\(p\+1\)==42: SUCCESS
\*\* 12 of 26 failed \(2 iterations\)
--
Expand Down
35 changes: 35 additions & 0 deletions regression/cbmc/union9/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <stdlib.h>
#include <stdint.h>

typedef union {
struct {
uint8_t x;
uint8_t z;
} b;
} union_t;

typedef struct {
uint32_t magic;
union_t unions[];
} flex;

int flex_init(flex * flex, size_t num)
{
if (num == 0 || num >= 200) {
return -1;
}
flex->unions[num - 1].b.z = 255;
return 0;
}

int main() {
uint8_t num = nondet_size();
flex * pool = (flex *) malloc(sizeof(flex) + num * sizeof(union_t));
int ret = flex_init(pool, num);
if (num > 0 && num < 200) {
__CPROVER_assert(ret == 0, "Accept inside range");
} else {
__CPROVER_assert(ret != 0, "Reject outside range");
}
}

8 changes: 8 additions & 0 deletions regression/cbmc/union9/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion scripts/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6511,7 +6511,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
if Search(r'(\.l|\.y|\.inc|\.d|\.o|y\.tab\.cpp|\.tab\.h|\.yy\.cpp)$', filename):
return

if Search(r'_builtin_headers_[a-z0-9_-]+\.h$', filename):
if Search(r'_builtin_headers(_[a-z0-9_-]+)?\.h$', filename):
return

if not ProcessConfigOverrides(filename):
Expand Down
13 changes: 13 additions & 0 deletions scripts/doxy_merge_driver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh

# This script can be used in conjunction with git and the doc-reformatting
# script (reformat_docs.py) to facilitate automatic rebases/merges spanning the
# transition to Doxygen-style comments.
# Usage information: https://svn.cprover.org/wiki/doku.php?id=doxygen

script_dir="$(dirname "$0")"

python "${script_dir}/reformat_docs.py" "$1" -i
python "${script_dir}/reformat_docs.py" "$2" -i
python "${script_dir}/reformat_docs.py" "$3" -i
git merge-file "$1" "$2" "$3"
3 changes: 2 additions & 1 deletion src/analyses/flow_insensitive_analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Author: Daniel Kroening, [email protected]
class flow_insensitive_abstract_domain_baset
{
public:
flow_insensitive_abstract_domain_baset()
flow_insensitive_abstract_domain_baset():
changed(false)
{
}

Expand Down
1 change: 1 addition & 0 deletions src/ansi-c/ansi_c_convert_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ansi_c_convert_typet:public messaget

explicit ansi_c_convert_typet(message_handlert &_message_handler):
messaget(_message_handler)
// class members are initialized by calling read()
{
}

Expand Down
7 changes: 6 additions & 1 deletion src/ansi-c/ansi_c_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ class ansi_c_parsert:public parsert
ansi_c_parse_treet parse_tree;

ansi_c_parsert():
cpp98(false), cpp11(false),
tag_following(false),
asm_block_following(false),
parenthesis_counter(0),
mode(modet::NONE),
cpp98(false),
cpp11(false),
for_has_scope(false)
{
}
Expand Down
Loading