File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
regression/cbmc/pointer-to-struct-with-flexible-array-member-as-parameter-to-entry-point Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.c
33--function testFunc
4- --
54^EXIT=0$
65^SIGNAL=0$
76--
8- ^EXIT=134$
97--
10- Github issue #5093: Pointer to struct with flexible array member as parameter to entry point causes invariant violation
8+ Github issue #5093: Pointer to struct with flexible array member as parameter to
9+ entry point causes invariant violation
Original file line number Diff line number Diff line change @@ -172,9 +172,11 @@ void symbol_factoryt::gen_nondet_array_init(
172172 auto const &array_type = to_array_type (expr.type ());
173173 const auto &size = array_type.size ();
174174 PRECONDITION (size.id () == ID_constant);
175- auto const array_size = numeric_cast_v<size_t >(to_constant_expr (size));
176- DATA_INVARIANT (array_size > 0 , " Arrays should have positive size" );
177- for (size_t index = 0 ; index < array_size; ++index)
175+ auto const array_size = numeric_cast<mp_integer>(to_constant_expr (size));
176+ DATA_INVARIANT (
177+ array_size.has_value () && *array_size >= 0 ,
178+ " Arrays should have positive size" );
179+ for (mp_integer index = 0 ; index < *array_size; ++index)
178180 {
179181 gen_nondet_init (
180182 assignments,
You can’t perform that action at this time.
0 commit comments