Skip to content

Commit bc2ee5b

Browse files
authored
Merge pull request #6243 from martin-cs/fix/arrays-6230
A simplified example that triggers issue 6230, from @SaswatPadhi
2 parents 432fb2e + 22e60dc commit bc2ee5b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

regression/cbmc/array-bug-6230/main.c

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdint.h>
2+
#include <stdlib.h>
3+
4+
struct inner
5+
{
6+
uint32_t exts[32]; // 32 is the minimum to crash
7+
};
8+
9+
struct outer
10+
{
11+
struct inner ctx; // Nesting is necessary
12+
};
13+
14+
int main()
15+
{
16+
struct outer *s = malloc(sizeof(struct outer));
17+
if(s != NULL)
18+
s->ctx.exts[0] = 0;
19+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--malloc-may-fail --malloc-fail-null --pointer-check
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
A simplified test case that triggers issue #6230

0 commit comments

Comments
 (0)