File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -728,6 +728,24 @@ void goto_programt::instructiont::validate(
728
728
ns);
729
729
}
730
730
731
+ if (
732
+ !symbol_expr_type_matches_symbol_table &&
733
+ goto_symbol_expr.type ().id () == ID_array &&
734
+ to_array_type (goto_symbol_expr.type ()).is_incomplete ())
735
+ {
736
+ // If the symbol expr has an incomplete array type, it may not have
737
+ // a constant size value, whereas the symbol table entry may have
738
+ // an (assumed) constant size of 1 (which mimics gcc behaviour)
739
+ if (table_symbol->type .id () == ID_array)
740
+ {
741
+ auto symbol_table_array_type = to_array_type (table_symbol->type );
742
+ symbol_table_array_type.size () = nil_exprt ();
743
+
744
+ symbol_expr_type_matches_symbol_table = base_type_eq (
745
+ goto_symbol_expr.type (), symbol_table_array_type, ns);
746
+ }
747
+ }
748
+
731
749
DATA_CHECK_WITH_DIAGNOSTICS (
732
750
vm,
733
751
symbol_expr_type_matches_symbol_table,
You can’t perform that action at this time.
0 commit comments