File tree 3 files changed +11
-7
lines changed 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,15 @@ typedef union
11
11
typedef struct
12
12
{
13
13
int Count;
14
- Union List[1 ];
14
+ // flexible array member -- note that smt conversion does not yet support
15
+ // 0-sized arrays
16
+ Union List[0 ];
15
17
} Struct3;
16
18
#pragma pack(pop)
17
19
18
20
int main ()
19
21
{
20
- Struct3 *p = malloc (sizeof (Struct3) + sizeof (Union));
22
+ Struct3 *p = malloc (sizeof (Struct3) + 2 * sizeof (Union));
21
23
p->Count = 3 ;
22
24
int po=0 ;
23
25
Original file line number Diff line number Diff line change 1
- CORE
1
+ CORE broken-smt-backend
2
2
main.i
3
3
--bounds-check --32 --no-simplify
4
4
^EXIT=10$
@@ -10,5 +10,6 @@ array\.List dynamic object upper bound in p->List\[2\]: FAILURE
10
10
--
11
11
Test is built from SV-COMP's memsafety/20051113-1.c_false-valid-memtrack.c.
12
12
C90 did not have flexible arrays, and using arrays of size 1 was common
13
- practice: http://c-faq.com/struct/structhack.html. We need to treat those as if
14
- it were a zero-sized array.
13
+ practice: http://c-faq.com/struct/structhack.html. But past C90 using
14
+ non-flexible members for struct-hack is undefined, hence we changed the test to
15
+ use flexible member instead.
Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ array\.List dynamic object upper bound in p->List\[2\]: FAILURE
10
10
--
11
11
Test is built from SV-COMP's memsafety/20051113-1.c_false-valid-memtrack.c.
12
12
C90 did not have flexible arrays, and using arrays of size 1 was common
13
- practice: http://c-faq.com/struct/structhack.html. We need to treat those as if
14
- it were a zero-sized array.
13
+ practice: http://c-faq.com/struct/structhack.html. But past C90 using
14
+ non-flexible members for struct-hack is undefined, hence we changed the test to
15
+ use flexible member instead.
You can’t perform that action at this time.
0 commit comments