Skip to content

Commit 4690ea5

Browse files
committed
Bugfix: Maintain safe_pointers per-path
The map of safe pointers is now maintained separately for each path, ensuring that pointer accesses on one path do not influence a (lack of) pointer accesses on a different path. This commit fixes diffblue#2866, a segfault that would happen when running CBMC on the included regression test.
1 parent d97f80f commit 4690ea5

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

regression/cbmc-path/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:cbmc>" -X smt-backend
3+
)

regression/cbmc-path/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
default: tests.log
2+
3+
test:
4+
@../test.pl -p -c ../../../src/cbmc/cbmc -X smt-backend
5+
6+
tests.log: ../test.pl
7+
@../test.pl -p -c ../../../src/cbmc/cbmc -X smt-backend
8+
9+
show:
10+
@for dir in *; do \
11+
if [ -d "$$dir" ]; then \
12+
vim -o "$$dir/*.c" "$$dir/*.out"; \
13+
fi; \
14+
done;
15+
16+
clean:
17+
find -name '*.out' -execdir $(RM) '{}' \;
18+
find -name '*.smt2' -execdir $(RM) '{}' \;
19+
$(RM) tests.log
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
int foo(int *x)
2+
{
3+
if(*x)
4+
{
5+
int y = 9;
6+
}
7+
else
8+
{
9+
int z = 4;
10+
}
11+
}
12+
13+
int main()
14+
{
15+
int x;
16+
foo(&x);
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--paths lifo
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)