Commit Graph

13722 Commits

Author SHA1 Message Date
Daniel Poetzl 4ae8eb6756 Move sharing map friends declarations to unit tests 2018-07-31 14:56:55 +01:00
Daniel Poetzl 186897c0bd Sharing stats for the sharing map 2018-07-31 14:56:50 +01:00
Daniel Poetzl 4438b436c4 Fix sharing map internal assertion 2018-07-31 14:26:03 +01:00
Daniel Poetzl 332febe884 Remove wrong sharing map internal assertions 2018-07-31 14:26:03 +01:00
Daniel Poetzl be7e140795 Activate internal checks for the sharing map unit tests 2018-07-31 14:26:03 +01:00
Daniel Kroening 713d3fe4f1
Merge pull request #2636 from polgreen/fix_function_map
if function is not in the function map, treat as if it has no body
2018-07-31 14:13:12 +01:00
Polgreen ea2d3933e3 Make test work on windows
This is a hack, but "__asm__ __volatile__ ("mfence": : :"memory");" doesn't compile on windows and the way CBMC handles "__asm mfence" needs to be fixed. Currently "__asm mfence" is not recognised as a function by CBMC.
2018-07-31 13:31:55 +02:00
Polgreen 6d0776fb5f if function is not in the function map, treat as if it has no body
For the call graph, we add the function to the call graph but do not try to look for function calls in the body.
For slicing global inits, we do not try to look in the function body for symbols.
This fixes issue https://github.com/diffblue/cbmc/issues/2631
2018-07-31 11:50:47 +02:00
Daniel Kroening da86bdb594
Merge pull request #2602 from diffblue/__CPROVER_r/w_ok
__CPROVER_r_ok and __CPROVER_w_ok preconditions
2018-07-31 10:50:18 +01:00
Daniel Kroening 0202f34620 refactor pointer_validity_check using address_check 2018-07-31 08:02:35 +01:00
Daniel Kroening 4a24ad40c7 use __CPROVER_r/w_ok in string.c library 2018-07-30 19:35:19 +01:00
Daniel Kroening 732ce2aee6 expand __CPROVER_r/w_ok in goto_check 2018-07-30 19:06:04 +01:00
Daniel Kroening acfea65cba __CPROVER_r_ok and __CPROVER_w_ok added to ANSI-C front-end 2018-07-30 19:06:04 +01:00
Daniel Kroening 0618f7d30a
Merge pull request #2628 from diffblue/clang-extensions
ansi-c: clang extensions
2018-07-30 19:00:28 +01:00
Daniel Kroening 5e43131c17
Merge pull request #2608 from diffblue/ms_cl_int64
added support for _int64 keyword
2018-07-30 18:59:49 +01:00
Daniel Kroening 7c5609140e
Merge pull request #2634 from qaphla/local_bitvector_analysis_regression
Added a regression test for local_bitvector_analysis
2018-07-30 18:58:35 +01:00
Daniel Kroening 44ef8d552a
Merge pull request #2630 from diffblue/invalid-pointer-flattening
fix flattening of ID_invalid_pointer
2018-07-30 18:52:04 +01:00
Daniel Kroening f74c161312 test for __float80 and __float128 2018-07-30 18:21:27 +01:00
Daniel Kroening 8288a72298 __float80 is a typedef, not a keyword 2018-07-30 18:21:27 +01:00
Daniel Kroening 54956259ad FreeBSD: default flavor is now CLANG 2018-07-30 18:21:27 +01:00
Daniel Kroening e63402efe5 added _Null_unspecified clang extension 2018-07-30 18:21:27 +01:00
Daniel Kroening 16a49a7c18 bugfix: __float128 2018-07-30 18:21:27 +01:00
Daniel Kroening 3849bb0f20 rename APPLE flavor to CLANG 2018-07-30 18:21:27 +01:00
Daniel Kroening 060b59c48a separate pointer check for integer addresses 2018-07-30 18:13:24 +01:00
Daniel Kroening 9b5847e33b fix flattening of ID_invalid_pointer 2018-07-30 18:12:05 +01:00
klaas 432dcf1f1c Added a regression test checking that --pointer-check does not generate
excess checks if local_bitvector_analysis can gather information on the
pointer being checked.
2018-07-30 11:02:35 -04:00
Chris Smowton 54f3731e9c
Merge pull request #2610 from smowton/smowton/fix/ssa-trace-unreachable-values
SSA trace: don't concretise steps that will subsequently be dropped
2018-07-30 15:27:37 +01:00
Daniel Kroening 6397f62cf8
Merge pull request #2626 from qaphla/local_bitvector_analysis_fix
Fixed a bug in local_bitvector_analysis wherein an expression's ID was used in place of the expression's type's ID.
2018-07-30 15:01:57 +01:00
Michael Tautschnig 0c0e2882f7
Merge pull request #2423 from tautschnig/vs-negation
Convert to signed type to make negation meaningful
2018-07-30 13:10:16 +01:00
Michael Tautschnig e90b61bab3 Transform float_utils unit test to use CATCH and enable it
It now tests both the approximating and non-approximating version of
float_utilst.
2018-07-30 12:15:59 +01:00
Michael Tautschnig 8b2bd7b849 Convert to signed type to make negation meaningful 2018-07-30 12:14:22 +01:00
Daniel Kroening cbfcc5c5d3 added support for _int64 keyword 2018-07-30 08:20:42 +01:00
Daniel Kroening 7823d9c553
Merge pull request #2606 from diffblue/ms_cl_options
two further Visual Studio CL options
2018-07-30 08:17:20 +01:00
Michael Tautschnig 0f60b26e66
Merge pull request #2627 from diffblue/cleanup-ansi-c-scanner
remove bitvector and bitvector_u rules
2018-07-29 19:31:05 +01:00
Daniel Kroening f33459fe7c
Merge pull request #2529 from tautschnig/debian1
Do not (unnecessarily) require preprocessing for fixed 32/64 bit regression tests
2018-07-28 14:02:25 +01:00
Daniel Kroening 1927fb28b5 remove bitvector and bitvector_u rules 2018-07-28 13:59:18 +01:00
klaas 1e075465f3 Fixed secondary issues arising from local_bitvector_analysis fix.
In particular, goto_check did not properly handle pointers whose value was an
integer address (such as int *p = 0x10 in the test case memory_allocation1).

This commit adds in pointer checks on pointers which are integer addresses,
treating them essentially the same as pointers which are unknown (and could
therefore point to any of the more well-defined types of memory objects),
except that they are known not to be null, so no check for NULL is needed.
2018-07-27 16:35:39 -04:00
klaas 131e525b6e Fixed a bug in local_bitvector_analysis wherein an expression's ID was
used in place of the expression's type's ID.

cr https://code.amazon.com/reviews/CR-2723653
2018-07-27 13:43:40 -04:00
Chris Smowton 501546ae4d SSA trace: don't concretise steps that will subsequently be dropped
Previously the SSA trace did all concretisation (taking the solver's output
and turning it into concrete expressions to be output in the result trace) before
sorting the steps by time and determining what belongs in the final trace. This
was generally harmless, but could result in much wasted time and potentially
memory exhaustion when concretising very large arrays and strings.

Therefore, we now perform the time-order sort and figure out which steps are
to be kept first, *then* concretise them.
2018-07-27 12:44:31 +01:00
Joel Allred 709b45f446
Merge pull request #2591 from allredj/log-suffix-in-testpl
Print log suffix when running tests
2018-07-27 11:57:50 +01:00
svorenova f3630f0b6a
Merge pull request #2612 from svorenova/multidim_arrays_tg3821_util
Add functions for checking (multi-dimensional) array types [TG-3821]
2018-07-27 09:29:40 +01:00
Daniel Kroening c010edb334
Merge pull request #2623 from diffblue/cbmc-empty-message
cbmc: avoid an empty message during result reporting
2018-07-27 07:25:26 +01:00
Daniel Kroening d5adef5968
Merge pull request #2624 from diffblue/va_arg_mode
symbols for va_args need a mode
2018-07-27 07:24:32 +01:00
Daniel Kroening 3e3303d662 symbols for va_args need a mode 2018-07-26 19:03:23 +01:00
Daniel Kroening 398dd39a5b cbmc: avoid an empty message during result reporting 2018-07-26 18:55:53 +01:00
Chris Smowton 8bca5cda7a
Merge pull request #2585 from smowton/smowton/admin/java-clean-deref-tests
Strengthen local_safe_pointers to handle common Java operations
2018-07-26 17:45:59 +01:00
Chris Smowton a0e339d573 Disable broken string test
This currently breaks an assertion as described in the .desc file. It should be re-enabled
once string-refinement knows how to introduce sufficient indirection to overcome this.
2018-07-26 15:48:59 +01:00
Chris Smowton d0cf433d4d Strengthen local_safe_pointers to handle common Java operations
The local-safe-pointers analysis can already inform symex that certain pointers
are known not to be null at particular program points. This strengthens the analysis
to spot more cases such that it can determine no null pointer is dereferenced in the
new regression test `jbmc/clean_derefs`, which exercises many common Java operations
including array accesses.

The specific improvements to local-safe-pointers:
 * Look through typecasts. This was already done for GOTO instructions, but now works
   for ASSUME as well.
 * Search for not-null expressions using base_type_eq instead of just irept::operator<.
   This means that when symex uses namespacet::follow to remove a symbol_typet that does
   not prevent local-safe-pointers from noting it is not null in a particular context.
2018-07-26 15:48:59 +01:00
Chris Smowton e7b1a8a1a6
Merge pull request #2616 from smowton/smowton/admin/ai-unit-test
Add test for ait framework
2018-07-26 14:42:47 +01:00
Daniel Kroening 738ecad810
Merge pull request #2621 from diffblue/amazon-linux-instructions
instructions for Amazon Linux
2018-07-26 13:18:30 +01:00