Commit Graph

18800 Commits

Author SHA1 Message Date
Michael Tautschnig fcf6fc0b37 Export-function-local-symbols name mangling: rename initial values
We previously renamed all occurrences in goto functions, but did not
consider the initial values of symbols with static lifetime, which are
stored in the symbol table. To make this reasonably efficient, make
rename_symbolt::operator() expose the return value (and document the
methods).

To test this, include the test suite in Makefile-based test set-ups
(CMake was already done), and fix the chain.sh file.
2019-05-01 11:08:28 +00:00
Michael Tautschnig 8811606378
Merge pull request #4595 from romainbrenguier/clean-up/field-sensitivity
field_sensitivityt::apply does not take a reference
2019-05-01 12:33:37 +03:00
Michael Tautschnig 07c5e1da0c
Merge pull request #2548 from tautschnig/vs-switch-case
Handle all enum values in switch/case [blocks: #2310]
2019-05-01 12:33:15 +03:00
Romain Brenguier a786eb3f83 field_sensitivityt::apply does not take a reference
We make apply take the expression by copy and return a transformed one.
This makes it more intuitive to use and avoid problems of the kind:

          index_exprt i;
          apply(ns, s, i, true);
          f_of_index_expr(i);

where in the call to `f_of_index_expr`, `i` is of type `index_exprt` but may not have
`ID_index` thus breaking an invariant which we should intuitively have.
2019-05-01 09:36:55 +01:00
Michael Tautschnig 93b2371ff7 Disable a number of invariants that currently fail
This takes us back to the behaviour prior to this series of commits, and
effectively is a to-do list to be addressed. We should either handle the cases,
or get rid of the instruction type.
2019-05-01 07:36:22 +00:00
Romain Brenguier 7293aca231
Merge pull request #4554 from romainbrenguier/clean-up/string-intern
Remove cprover_string_intern handling in the solver
2019-05-01 06:32:12 +01:00
martin d28968c29e Annotate missed cases in the transform functions of various domains
There are a number of reasons why instruction types were left out of
these case statements :

1. Ignoring this instruction is generally a valid overapproximation.
2. Ignoring this instruction is a valid overapproximation for this
   domain.
3. The instruction is assumed to not be present due to preceding
   passes.
4. The instruction should never appear in any valid goto program.
5. The instruction is newer than the analysis code and was forgotten.

This patch tries to correctly document which of these apply.
2019-04-30 23:57:24 +00:00
Michael Tautschnig 81fb35fdfd clang-format switch statements touched in this PR 2019-04-30 23:57:24 +00:00
Michael Tautschnig 87e86bbf43 Disable clang-format for recently touched switch statements
We should not re-indent a large number of lines of code just because some case
statements were added. Silence clang-format for these instead.
2019-04-30 23:55:26 +00:00
Michael Tautschnig 5e1c7bf0cc Add -Wswitch-enum to default GCC/Clang build options
This is now consistent with the warnings that Visual Studio would generate,
which warns about missing enum cases in switch/case even when a default: is
present.
2019-04-30 23:55:26 +00:00
Michael Tautschnig 81cd230198 Handle all enum values in switch/case 2019-04-30 23:55:26 +00:00
Michael Tautschnig d6eae52499
Merge pull request #4041 from tautschnig/empty-string
Cleanup use of empty strings
2019-05-01 02:54:49 +03:00
Michael Tautschnig 104a704e96
Merge pull request #3867 from tautschnig/osx-hybrid-binaries
goto-gcc hybrid binaries on OS X
2019-05-01 02:26:07 +03:00
Michael Tautschnig 13b3e4fdef Use s.empty() or !s.empty() instead of comparison to irep_idt()
This avoids constructing an object when we can just use an integer comparison.
2019-04-30 22:35:06 +00:00
Michael Tautschnig 29a9ce80ee Remove unnecessary uses of ""
Appending "" to a string has no effect.
2019-04-30 22:35:06 +00:00
Michael Tautschnig 7e5b60fb69 Use s.clear() instead of s=""
This avoids string table lookups.
2019-04-30 22:34:56 +00:00
Michael Tautschnig 672e711965 The second argument to java_type_from_string is optional 2019-04-30 22:34:01 +00:00
Michael Tautschnig 8a277eff2b Use irep_idt() instead of ""
Constructing a dstringt from a C string requires a string table lookup, while
the default constructor for a dstringt just zero-initialises an unsigned.
2019-04-30 22:34:01 +00:00
Michael Tautschnig 0210503544 Use !s.empty() instead of s != ""
The use of "" requires constructing a std::string or dstringt, and then a
string comparison. empty() is just an integer comparison (both for std::string
an dstringt).
2019-04-30 22:32:36 +00:00
Michael Tautschnig c1baa03b2e Remove redundant string initialisation
Both std::string and dstringt are default-initialised to an empty string.
2019-04-30 22:30:57 +00:00
Michael Tautschnig ec56872cdc Use s.empty() instead of s == ""
The use of "" requires constructing a std::string or dstringt, and then a string
comparison. empty() is just an integer comparison (both for std::string an
dstringt).
2019-04-30 22:30:57 +00:00
Michael Tautschnig 03123a9941 taint_analysis: make last argument optional
We previously passed in empty strings. Make explicit that the argument is not
required.
2019-04-30 22:28:21 +00:00
Michael Tautschnig c7e8bccd85 Detect OSX fat archives or Mach-O objects on all architectures
Hard-code the magic values as extracted from OS X header files, but
check them when actually building on OS X.
2019-04-30 22:26:54 +00:00
Michael Tautschnig d155d87802 Test loading files from an archive
The test requires building platform-specific code, and thus additional rules
were added to the Makefile.
2019-04-30 22:26:20 +00:00
Michael Tautschnig c1108c998f Read goto-cc section from Mach-O object files
A basic Mach-O header parser, only functional on OS X.
2019-04-30 22:26:16 +00:00
Michael Tautschnig 4a40717c4a OS X hybrid binaries: use sections for object files
lipo/fat binaries only work properly for executables as it isn't possible to
build archives of fat binaries containing goto-cc sections (ranlib complains
about invalid object files); conversely, adding additional sections isn't
possible with executables, but fat binaries work fine.
2019-04-30 22:26:02 +00:00
Michael Tautschnig 3d94a62d83
Merge pull request #4591 from diffblue/config_main_optional
config.main is now optionalt<string> [blocks: #4041]
2019-05-01 01:24:54 +03:00
Romain Brenguier 524c13ff2d Improve test for String.intern
We add a version of the test which should fail in addition to the one
that should pass.
2019-04-30 21:13:22 +01:00
Romain Brenguier e6a5a11a4e Remove cprover_string_intern handling in the solver
This has never been tested and should rather be handled by the models,
it is a Java specific feature.
2019-04-30 21:13:21 +01:00
Romain Brenguier b7667ec9df Add models to String.intern test
This will become necessary when the String.intern implementation is
moved to models.
2019-04-30 21:13:21 +01:00
Romain Brenguier 426ff72ec8 Update submodule for diffblue/java-models-library#22 (String.intern)
This contains a model for String.intern
https://github.com/diffblue/java-models-library/pull/22
2019-04-30 21:13:21 +01:00
Daniel Kroening bef4da35b1 config.main is now optionalt<string>
This avoids the use of 'empty string' as indicator of 'no value'
2019-04-30 14:47:25 +01:00
Michael Tautschnig b8539ce586 expr2c: Remove precedence parameter where unused 2019-04-30 14:38:41 +01:00
Michael Tautschnig c003aa2c34 Read "is inlined" attribute of goto functions from the symbol table
There should only be a single place to hold type information, including
attributes, to ensure consistency. Future changes will remove the "type" member
of goto_functiont, making the type information stored in the symbol table the
single, authoritative source of information.

The "is inlined" information should already be consistent/redundant. This commit
makes all read accesses use the information stored in the symbol table, and also
uses a modern API for doing so.
2019-04-30 14:37:42 +01:00
antlechner 0e16cbbbcb
Merge pull request #4590 from antlechner/antonia/json-parsing-unicode
Implement parsing of hexadecimal Unicode characters from JSON
2019-04-30 11:54:45 +01:00
Antonia Lechner 06e666b802 Implement parsing of Unicode characters from JSON
Previously, if a JSON file contained a string in hexadecimal Unicode
representation, e.g. "\u0001", the JSON parser would discard the "\u"
part and store the string as "0001". This commit fixes this so the
resulting string is equal to "\u0001".
2019-04-30 11:05:10 +01:00
Michael Tautschnig 3aa6e16a10 Disable support for pthread_keyt destructors
They are too expensive due to extensive shared-variable use.
2019-04-30 09:50:29 +01:00
Michael Tautschnig 6ff80c4cc0 C library: model pthread_key_create, pthread_{get,set}specific
This is used by pthread-divine/tls_basic_true-unreach-call in SV-COMP.
2019-04-30 09:50:29 +01:00
Chris Smowton 3077044d16
Merge pull request #4588 from peterschrammel/json-interface-jbmc
Add json/xml-interface to JBMC
2019-04-30 09:27:17 +01:00
Michael Tautschnig 87bb244b6b
Merge pull request #4589 from peterschrammel/smt2-conv-inherit
Clean up smt2_conv
2019-04-30 01:32:50 +03:00
Peter Schrammel ee7f2c9443 Remove unnecessary no-lint comment 2019-04-29 18:30:22 +01:00
Peter Schrammel 5d522905d0 Add json/xml-interface to JBMC 2019-04-29 18:30:21 +01:00
Peter Schrammel 1f75429595 Clean-up smt2_convt interface
Move definitions into .cpp file
and make functions protected that don't
need to be public.
2019-04-29 18:24:14 +01:00
Peter Schrammel de2202a051 Make smt2_convt inherit from stack_decision_proceduret directly 2019-04-29 18:24:14 +01:00
Peter Schrammel cb2f5ea72a
Merge pull request #4587 from peterschrammel/get-decision-procedure
Allow getting specific decision procedure interface
2019-04-29 18:22:53 +01:00
Peter Schrammel 16ba2549b5 Factor out help text for json-interface 2019-04-29 17:56:49 +01:00
Peter Schrammel f0f244f94c Factor out help text for xml-interface 2019-04-29 17:53:39 +01:00
Chris Smowton 0128bb26ec
Merge pull request #4574 from smowton/smowton/fix/brittle-goto-symex-is-constant
goto-symex-is-constant: treat `x * sizeof(t)` and `sizeof(t) * x` alike
2019-04-29 15:52:22 +01:00
Chris Smowton 44844d82ce
Merge pull request #4575 from smowton/smowton/cleanup/factor-value-set-deref
value-set-dereference: factor out should_ignore_value
2019-04-29 15:52:00 +01:00
Daniel Poetzl d14ffbcd7b
Merge pull request #4582 from danpoe/refactor/sharing-map-iteration
Make sharing map iteration independent of tree depth
2019-04-29 15:45:56 +01:00