Skip to content

Commit 820fd35

Browse files
Add KNOWNBUG regression test for GH issue #4168
1 parent 606a83a commit 820fd35

File tree

2 files changed

+29
-0
lines changed
  • regression/cbmc/assigning_nullpointers_should_not_crash_symex

2 files changed

+29
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <assert.h>
2+
#include <stddef.h>
3+
4+
struct linked_list
5+
{
6+
struct linked_list *next;
7+
};
8+
9+
int main(void)
10+
{
11+
size_t list_sz = 8ul;
12+
assert(list_sz == sizeof(struct linked_list));
13+
struct linked_list *list = malloc(list_sz);
14+
// this line makes symex crash for some reason
15+
// last known to work on 9cf2bfb3e458d419d842a0e1fd26fb1748451851
16+
// (no bisection has been done yet to narrow down the source of the error)
17+
list->next = (struct linked_list *)0;
18+
assert(!list->next);
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
This tests for the regression described in https://github.com/diffblue/cbmc/issues/4168

0 commit comments

Comments
 (0)