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 @@ -740,6 +740,24 @@ void goto_programt::instructiont::validate(
740
740
}
741
741
}
742
742
743
+ if (
744
+ !symbol_expr_type_matches_symbol_table &&
745
+ goto_symbol_expr.type ().id () == ID_array &&
746
+ to_array_type (goto_symbol_expr.type ()).is_incomplete ())
747
+ {
748
+ // If the symbol expr has an incomplete array type, it may not have
749
+ // a constant size value, whereas the symbol table entry may have
750
+ // an (assumed) constant size of 1 (which mimics gcc behaviour)
751
+ if (table_symbol->type .id () == ID_array)
752
+ {
753
+ auto symbol_table_array_type = to_array_type (table_symbol->type );
754
+ symbol_table_array_type.size () = nil_exprt ();
755
+
756
+ symbol_expr_type_matches_symbol_table = base_type_eq (
757
+ goto_symbol_expr.type (), symbol_table_array_type, ns);
758
+ }
759
+ }
760
+
743
761
DATA_CHECK_WITH_DIAGNOSTICS (
744
762
vm,
745
763
symbol_expr_type_matches_symbol_table,
You can’t perform that action at this time.
0 commit comments