Skip to content

Commit 5a58539

Browse files
authored
Merge pull request #1354 from NathanJPhillips/merge-develop-to-sss
Merge develop to security scanner support
2 parents 52eb7ed + 5648db1 commit 5a58539

File tree

171 files changed

+3184
-1105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+3184
-1105
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ install:
160160
eval ${PRE_COMMAND} ${COMMAND}
161161
- COMMAND="make -C src boost-download" &&
162162
eval ${PRE_COMMAND} ${COMMAND}
163+
- COMMAND="make -C src/ansi-c library_check" &&
164+
eval ${PRE_COMMAND} ${COMMAND}
163165
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g -DUSE_BOOST $EXTRA_CXXFLAGS\" -j2" &&
164166
eval ${PRE_COMMAND} ${COMMAND}
165167
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 clobber.dir memory-models.dir musketeer.dir" &&

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* GOTO-INSTRUMENT: New option --remove-function-body
1111
* GOTO-INSTRUMENT: New option --use-all-headers, changed --use-system-headers to
1212
--no-system-headers
13+
* GOTO-INSTRUMENT: dump-c can output the generated environment via --harness
1314

1415

1516
5.7

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ test_script:
109109
rmdir /s /q cbmc-java\classpath1
110110
rmdir /s /q cbmc-java\jar-file3
111111
rmdir /s /q cbmc-java\tableswitch2
112+
rmdir /s /q goto-gcc
112113
rmdir /s /q goto-instrument\slice08
113114
114115
make test

regression/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
DIRS = ansi-c \
22
cbmc \
3-
cpp \
3+
cbmc-cover \
44
cbmc-java \
55
cbmc-java-inheritance \
6+
cpp \
67
goto-analyzer \
78
goto-diff \
9+
goto-gcc \
810
goto-instrument \
911
goto-instrument-typedef \
1012
invariants \
@@ -13,9 +15,14 @@ DIRS = ansi-c \
1315
test-script \
1416
# Empty last line
1517

16-
18+
# Check for the existence of $dir. Tests under goto-gcc cannot be run on
19+
# Windows, so appveyor.yml unlinks the entire directory under Windows.
1720
test:
18-
$(foreach var,$(DIRS), $(MAKE) -C $(var) test || exit 1;)
21+
@for dir in $(DIRS); do \
22+
if [ -d "$$dir" ]; then \
23+
$(MAKE) -C "$$dir" test || exit 1; \
24+
fi; \
25+
done;
1926

2027
clean:
2128
@for dir in *; do \

regression/ansi-c/Union_Padding1/main.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,33 @@ STATIC_ASSERT(sizeof(union some_union4)==3);
6262

6363
#endif
6464

65+
#ifdef _MSC_VER
66+
67+
union some_union5
68+
{
69+
int i;
70+
};
71+
72+
STATIC_ASSERT(__alignof(union some_union5)==1);
73+
74+
#else
75+
76+
union some_union5
77+
{
78+
int i;
79+
};
80+
81+
union some_union6
82+
{
83+
int i;
84+
} __attribute__((__packed__));
85+
86+
// Packing may affect alignment
87+
STATIC_ASSERT(_Alignof(union some_union5)==4);
88+
STATIC_ASSERT(_Alignof(union some_union6)==1);
89+
90+
#endif
91+
6592
int main()
6693
{
6794
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
static unsigned bar()
2+
{
3+
unsigned r;
4+
return r;
5+
}
6+
7+
#ifdef _MSC_VER
8+
9+
static void foo()
10+
{
11+
}
12+
13+
#else
14+
15+
static void foo()
16+
{
17+
unsigned len=bar();
18+
struct {
19+
int a;
20+
union {
21+
int s;
22+
unsigned char b[len];
23+
} __attribute__ (( packed )) S;
24+
int c;
25+
} __attribute__ (( packed )) *l;
26+
}
27+
28+
#endif
29+
30+
int main()
31+
{
32+
foo();
33+
return 0;
34+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extern char src_start[];
2+
extern char src_end[];
3+
extern char dst_start[];
4+
5+
void *memcpy(void *dest, void *src, unsigned n){
6+
return (void *)0;
7+
}
8+
9+
int main(){
10+
memcpy(dst_start, src_start, (unsigned)src_end - (unsigned)src_start);
11+
return 0;
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MEMORY {
2+
RAM : ORIGIN = 0x0, LENGTH = 25M
3+
}
4+
5+
SECTIONS
6+
{
7+
/* GCC insists on having these */
8+
.note.gnu.build-id : { } > RAM
9+
.text : { } > RAM
10+
11+
.src_section : {
12+
src_start = .;
13+
*(.text*)
14+
src_end = .;
15+
} > RAM
16+
17+
.dst_section : {
18+
dst_start = .;
19+
*(.text*)
20+
dst_end = .;
21+
} > RAM
22+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CORE
2+
main.c
3+
-o out.gb -T script.ld -nostdlib
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$
9+
--
10+
Tesing the functionality of goto-cc's linker script parsing
11+
functionality, ensuring that it can get the values of symbols that are
12+
defined in linker scripts.
13+
14+
This test ensures that goto-cc and ls-parse can:
15+
16+
- get the value of a symbol whose value indicates the start of a section;
17+
- get the value of a symbol whose value indicates the end of a section.

0 commit comments

Comments
 (0)