Commit Graph

20015 Commits

Author SHA1 Message Date
Daniel Poetzl ca203b905e Factor out charAt() and startsWith() simplification into separate functions 2019-07-16 22:37:44 +01:00
Lukasz A.J. Wrona 6ed1c121df Add size property to json_objectt 2019-07-16 17:16:25 +01:00
Matthias Weiss 0ad55a4055 Add support for STL return value assignment
Special case for the presence of a return value in the
call assignment list.
2019-07-16 16:36:17 +01:00
Matthias Weiss 0d5bd73660 Add typecheck support for empty STL modules
Changes the way STL module symbols are generated so that they only have
a value if temp variables and/or networks are present.
2019-07-16 16:36:17 +01:00
Nathan Phillips c6c0eff1bc
Merge pull request #4897 from diffblue/cleanup/generic_parameter_specialization_map_keys
Cleanup generic_parameter_specialization_map_keys
2019-07-16 14:24:57 +01:00
Owen 2c36f47d7d Test symex can resolve class identifier
Test that symex knows the class identifier of nondet-initialised inputs
to the entrypoint function.
2019-07-16 11:00:36 +01:00
Owen 2fef1ebdbf Make regression tests for trace work 2019-07-16 11:00:36 +01:00
Owen bebaf01231 Make java generics unit tests work again
They inspect the exact code produced very closely, so they need to be
updated to expect code with dynamic allocations instead of automatic
local allocations in some places
2019-07-16 11:00:36 +01:00
Owen 4c6c4a2e00 Do not make reference to temporary variable
This should not be a reference
2019-07-16 11:00:36 +01:00
Owen f5f7aa528d Dynamically allocate arguments to java entry point
This was already done for arguments that had more than one
object type.

The motivation for this is that when nondet-initialising the
argument with automatic local allocation we were creating the
object to be pointed to and only initialising it when the
argument is non-null, and then symex couldn't resolve the
class identifier, which stopped it from doing various
optimisations and producing a simpler formula.
2019-07-16 11:00:36 +01:00
Nathan Phillips 508a717c0d Code clarity/readability
Return early on problems to avoid having to remember the problem until the end of a large block and to reduce nesting
Indent TODO comments to keep them together and help IDE's to highlight them correctly
Name expressions that are used repeatedly
Remove unused parameter names
Use count instead of find if the returned value isn't used
Clarified the English in comments
2019-07-16 10:52:34 +01:00
Nathan Phillips e53c793807 Avoid repeated searches in map 2019-07-16 10:48:13 +01:00
Nathan Phillips 79a6af4ca8 Removed unused include 2019-07-16 10:41:52 +01:00
Nathan Phillips 868de74e33 Use standard zip function to clarify code 2019-07-16 10:41:52 +01:00
Daniel Kroening da8a63ef93
Merge pull request #4911 from diffblue/cleanup/range_const_return
Removed const from return types where they return by value
2019-07-15 11:35:33 -04:00
Nathan Phillips e813166a5e Removed const from return types where they return by value
This must have been added by mistake as it has no effect at all.
2019-07-15 15:26:36 +01:00
Michael Tautschnig 3e2bea332b
Merge pull request #4903 from tautschnig/memcpy-strings
Support OBJECT_SIZE over string constants
2019-07-15 11:34:15 +01:00
Michael Tautschnig a47ec2dfc1
Merge pull request #4902 from tautschnig/bitand
Value sets: Support bitand/bitor over pointers
2019-07-15 11:33:59 +01:00
Michael Tautschnig cc941d3ad5 Value sets: Support bit operations over pointers
Bit operations on pointers are used to defend against side channels
resulting from speculative execution. Hence we need to support these.
Without the support in value sets we silently just returned "unknown"
and thus subsequent dereferencing would fail.
2019-07-15 09:37:45 +00:00
Michael Tautschnig 1ba3dfb32e Support OBJECT_SIZE over string constants
Pointer checks (including __CPROVER_{r,w}_ok) over string constants
should succeed when the access is within bounds. To do so, we must no
return non-deterministic values for the object size of string constants.

Fixes: #4871
2019-07-15 09:32:54 +00:00
Michael Tautschnig adbc5fb435
Merge pull request #4900 from tautschnig/null-pointer-fix
Null-pointer filtering must handle unknown offsets
2019-07-15 10:28:21 +01:00
Michael Tautschnig 250b140106
Merge pull request #4874 from diffblue/simplifier_new_interface3
Simplifier: new interface, final piece [blocks: #4904]
2019-07-14 15:11:32 +01:00
Daniel Kroening 412754c2f8 improved typing in simplify_boolean
This improves type safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 16e18d22e9 removed unneeded call to simplify_node in simplify_boolean
Follow-up from comment in #4872. The call is a no-op.
2019-07-14 07:58:34 -04:00
Daniel Kroening 2099dfef2c type simplify_unary_plus
This improves type safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 488e4ef113 type simplify_concatenation
This improves type safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening be1f6fa7dd simplifier: type remaining methods for unary expressions
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening fddeaf9cf1 type simplify_unary_minus
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 7fe45614b7 type simplify_member
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 1d532960ef type simplify_index
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening d061aaa189 type simplify_not
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 866acc9a0a type simplify_bitnot
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening b42d47d914 type simplify_extractbit
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening db75bb7775 type simplify_sign
This improves memory safety.
2019-07-14 07:58:34 -04:00
Daniel Kroening 5d180cbcfa simplify_inequality_* methods use new interface
This improves type safety.
2019-07-14 07:58:34 -04:00
Yumi Bagge a7f7d37648 Remove all badges 2019-07-14 08:22:28 +01:00
Daniel Kroening 37b642cad2 simplify_expr_if: result -> nochange 2019-07-13 14:53:06 -04:00
Daniel Kroening 5295cb7a61 simplifier: move if_expr related methods into separate file
These have tight coupling, and there is a sufficient number of them.
2019-07-13 14:53:06 -04:00
Daniel Kroening a7a20a4a59 simplifier: simplify_rec has new interface
This improves type safety.
2019-07-13 14:53:06 -04:00
Daniel Kroening ef6cceb141 simplifier: prevent spurious adding of type
Expressions should not be given a type() child if they don't have one.
2019-07-13 14:53:06 -04:00
Daniel Kroening eda7601b62 simplifier: use new interface 2019-07-13 14:53:06 -04:00
Michael Tautschnig a941ba947e
Merge pull request #4872 from diffblue/simplifier_new_interface2
simplifier: use new interface
2019-07-13 16:17:27 +01:00
Daniel Kroening 7a4440313b allow the application of functions that aren't symbols
SMT-LIB 3 will bring function applications for terms that aren't symbols
(e.g., lambda, choice).

This commit removes the restriction that the function in a function
application has to be a symbol.  The expression is still required to have
function type.
2019-07-13 06:23:53 -04:00
Daniel Kroening e288906280
Merge pull request #4901 from tautschnig/array-of
C front-end: Permit array_of as array initializer
2019-07-13 10:47:19 +01:00
Michael Tautschnig 5ded04d40d C front-end: Permit array_of as array initializer
Since 375e9a8cfd we generate array_of expressions for large arrays.
The C front-end must also be made aware of this.
2019-07-12 19:13:17 +00:00
Michael Tautschnig 4a095a2363 Null-pointer filtering must handle unknown offsets
A non-constant offset is stored as "unknown," which does include an
offset of zero. As constant + zero == constant we should not conclude
that the constant is not contained in the set.
2019-07-12 18:45:24 +00:00
Yumi Bagge a5fd2df822 Add regression test for multidimentional char array 2019-07-12 19:02:32 +01:00
svorenova fef6d08ad4
Merge pull request #4893 from svorenova/not-null-annotation-check-location
Correct the source location of methods and not null annotation checks [TG-8270]
2019-07-12 16:14:01 +01:00
Michael Tautschnig e7a78aa56b
Merge pull request #4848 from diffblue/pointer_check_beautification
Pointer check beautification
2019-07-12 14:50:41 +01:00
Michael Tautschnig b7bad44533
Merge pull request #4881 from diffblue/bison-header-file
set the name of bison-generated header file
2019-07-12 13:41:23 +01:00