diff --git a/src/ansi-c/goto-conversion/goto_check_c.cpp b/src/ansi-c/goto-conversion/goto_check_c.cpp index ad0419853a9..43e03284d7c 100644 --- a/src/ansi-c/goto-conversion/goto_check_c.cpp +++ b/src/ansi-c/goto-conversion/goto_check_c.cpp @@ -1593,6 +1593,12 @@ void goto_check_ct::bounds_check_index( throw "bounds check expected array or vector type, got " + array_type.id_string(); + // Skip bounds checking for unbounded arrays (no constant size). + if( + array_type.id() == ID_array && + !to_array_type(array_type).size().is_constant()) + return; + std::string name = array_name(expr.array()); const exprt &index = expr.index();