File tree 2 files changed +8
-7
lines changed
regression/cbmc/pointer-to-struct-with-flexible-array-member-as-parameter-to-entry-point
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
3
--function testFunc
4
- --
5
4
^EXIT=0$
6
5
^SIGNAL=0$
7
6
--
8
- ^EXIT=134$
9
7
--
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(
172
172
auto const &array_type = to_array_type (expr.type ());
173
173
const auto &size = array_type.size ();
174
174
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 )
178
180
{
179
181
gen_nondet_init (
180
182
assignments,
You can’t perform that action at this time.
0 commit comments