Skip to content

Update security-scanner-support to current master #583

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

Merged
merged 32 commits into from
Mar 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d70afb7
Skip already-loaded Java classes
smowton Oct 24, 2016
11ff2b2
Convert Java methods only when they have a caller
smowton Nov 1, 2016
fcd03f9
Remove dead global variables
smowton Nov 1, 2016
7f752bb
Restrict virtual method targets to known-created types
smowton Nov 2, 2016
e1cb0c4
Mark all classes in root jar reachable if it doesn't declare a main f…
smowton Nov 21, 2016
c10849c
Add this-parameter before determining needed classes
smowton Nov 23, 2016
8d96409
Lazy method conversion: load callee parent classes
smowton Nov 30, 2016
2024c34
Always assume String, Class and Object are callable
smowton Jan 17, 2017
6700a56
Don't try to call an abstract function
smowton Jan 17, 2017
79ff667
Make lazy method loading optional
smowton Jan 25, 2017
5be7106
Add CBMC lazy-methods parameter
smowton Feb 6, 2017
d932cfd
Document lazy methods
smowton Feb 9, 2017
d19448a
Style fixes
smowton Feb 9, 2017
7c669b2
Add lazy loading tests
smowton Feb 9, 2017
b909a54
Improve code style
smowton Feb 13, 2017
145c2d4
Use safe pointers for optional arguments
smowton Feb 15, 2017
8e38c0e
Add lazy conversion documentation
smowton Feb 15, 2017
73e0479
Improve failed test printer
smowton Feb 15, 2017
6ef7327
Conversion utf8 to utf16 and pretty-printing of Java strings
smowton Oct 5, 2016
0541fcd
Require libstdc++ from g++-5 to build with Clang
smowton Feb 13, 2017
e433cd4
Rework utf16-to-ascii to avoid snprintf
smowton Feb 13, 2017
927d54a
Style unicode.cpp/h
smowton Feb 22, 2017
3cb7bca
Cleaning dependencies of the string solver
romainbrenguier Feb 14, 2017
425f819
Merge pull request #407 from smowton/java_basic_lazy_conversion
Feb 27, 2017
e33caad
Remove aa-symex from DIRS variable in Makefile
Feb 28, 2017
9f6ca11
Merge pull request #577 from nmanthey/fix-aa-symex
Feb 28, 2017
d1e691e
Merge pull request #541 from smowton/string-refine-unicode
Mar 1, 2017
ca11bb3
Introduce java.lang.String when string-refinement is activated
romainbrenguier Feb 2, 2017
396f66e
Init string constants when refine-string disabled
smowton Feb 20, 2017
4e4fa87
Style and document Java string-refine integration
smowton Feb 21, 2017
37163d8
Merge pull request #549 from romainbrenguier/string-refinement-depend…
Mar 1, 2017
c8c9085
Merge pull request #559 from smowton/string-refine-java-bytecode
Mar 1, 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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ matrix:
packages:
- libwww-perl
- clang-3.7
- libstdc++-5-dev
- libubsan0
before_install:
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
Expand Down
Binary file added regression/cbmc-java/lazyloading1/A.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading1/B.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading1/test.class
Binary file not shown.
8 changes: 8 additions & 0 deletions regression/cbmc-java/lazyloading1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class
--lazy-methods --verbosity 10 --function test.main
^EXIT=0$
^SIGNAL=0$
elaborate java::A\.f:\(\)V
--
elaborate java::B\.g:\(\)V
21 changes: 21 additions & 0 deletions regression/cbmc-java/lazyloading1/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// The most basic lazy loading test: A::f is directly called, B::g should be unreachable

public class test
{
A a;
B b;
public static void main()
{
A.f();
}
}

class A
{
public static void f() {}
}

class B
{
public static void g() {}
}
Binary file added regression/cbmc-java/lazyloading2/A.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading2/B.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading2/test.class
Binary file not shown.
8 changes: 8 additions & 0 deletions regression/cbmc-java/lazyloading2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class
--lazy-methods --verbosity 10 --function test.main
^EXIT=0$
^SIGNAL=0$
elaborate java::A\.f:\(\)V
--
elaborate java::B\.g:\(\)V
23 changes: 23 additions & 0 deletions regression/cbmc-java/lazyloading2/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// This test checks that because A is instantiated in main and B is not,
// A::f is reachable and B::g is not

public class test
{
A a;
B b;
public static void main()
{
A a = new A();
a.f();
}
}

class A
{
public void f() {}
}

class B
{
public void g() {}
}
Binary file added regression/cbmc-java/lazyloading3/A.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading3/B.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading3/C.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading3/D.class
Binary file not shown.
Binary file added regression/cbmc-java/lazyloading3/test.class
Binary file not shown.
8 changes: 8 additions & 0 deletions regression/cbmc-java/lazyloading3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class
--lazy-methods --verbosity 10 --function test.main
^EXIT=0$
^SIGNAL=0$
elaborate java::A\.f:\(\)V
--
elaborate java::B\.g:\(\)V
30 changes: 30 additions & 0 deletions regression/cbmc-java/lazyloading3/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This test checks that because `main` has a parameter of type C, which has a field of type A,
// A::f is considered reachable, but B::g is not.

public class test
{
public static void main(C c)
{
c.a.f();
}
}

class A
{
public void f() {}
}

class B
{
public void g() {}
}

class C
{
A a;
}

class D
{
B b;
}
22 changes: 12 additions & 10 deletions regression/failed-tests-printer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@

open LOG,"<tests.log" or die "Failed to open tests.log\n";

my $ignore = 1;
my $printed_this_test = 1;
my $current_test = "";

while (<LOG>) {
chomp;
if (/^Test '(.+)'/) {
$current_test = $1;
$ignore = 0;
} elsif (1 == $ignore) {
next;
$printed_this_test = 0;
} elsif (/\[FAILED\]\s*$/) {
$ignore = 1;
print "Failed test: $current_test\n";
my $outf = `sed -n '2p' $current_test/test.desc`;
$outf =~ s/\..*$/.out/;
system("cat $current_test/$outf");
print "\n\n";
if(0 == $printed_this_test) {
$printed_this_test = 1;
print "\n\n";
print "Failed test: $current_test\n";
my $outf = `sed -n '2p' $current_test/test.desc`;
$outf =~ s/\..*$/.out/;
system("cat $current_test/$outf");
print "\n\nFailed test.desc lines:\n";
}
print "$_\n";
}
}

4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DIRS = ansi-c big-int cbmc cpp goto-cc goto-instrument goto-programs \
goto-symex langapi pointer-analysis solvers util linking xmllang \
assembler analyses java_bytecode aa-path-symex path-symex musketeer \
json cegis goto-analyzer jsil symex goto-diff aa-symex clobber \
assembler analyses java_bytecode path-symex musketeer \
json cegis goto-analyzer jsil symex goto-diff clobber \
memory-models

all: cbmc.dir goto-cc.dir goto-instrument.dir symex.dir goto-analyzer.dir goto-diff.dir
Expand Down
1 change: 1 addition & 0 deletions src/cbmc/cbmc_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class optionst;
"(graphml-witness):" \
"(java-max-vla-length):(java-unwind-enum-static)" \
"(localize-faults)(localize-faults-method):" \
"(lazy-methods)" \
"(fixedbv)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)

class cbmc_parse_optionst:
Expand Down
6 changes: 3 additions & 3 deletions src/goto-cc/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ bool compilet::parse(const std::string &file_name)

language_filet language_file;

std::pair<language_filest::filemapt::iterator, bool>
res=language_files.filemap.insert(
std::pair<language_filest::file_mapt::iterator, bool>
res=language_files.file_map.insert(
std::pair<std::string, language_filet>(file_name, language_file));

language_filet &lf=res.first->second;
Expand Down Expand Up @@ -736,7 +736,7 @@ bool compilet::parse_source(const std::string &file_name)
return true;

// so we remove it from the list afterwards
language_files.filemap.erase(file_name);
language_files.file_map.erase(file_name);
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/goto-programs/get_goto_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ bool get_goto_modelt::operator()(const std::vector<std::string> &files)
return true;
}

std::pair<language_filest::filemapt::iterator, bool>
result=language_files.filemap.insert(
std::pair<language_filest::file_mapt::iterator, bool>
result=language_files.file_map.insert(
std::pair<std::string, language_filet>(filename, language_filet()));

language_filet &lf=result.first->second;
Expand Down
3 changes: 2 additions & 1 deletion src/goto-programs/remove_virtual_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ void remove_virtual_functionst::get_functions(
component_name,
functions);

functions.push_back(root_function);
if(root_function.symbol_expr!=symbol_exprt())
functions.push_back(root_function);
}

/*******************************************************************\
Expand Down
Loading