@@ -680,13 +680,6 @@ void goto_programt::instructiont::validate(
680
680
validate_full_code (code, ns, vm);
681
681
validate_full_expr (guard, ns, vm);
682
682
683
- const symbolt *table_symbol;
684
- DATA_CHECK_WITH_DIAGNOSTICS (
685
- vm,
686
- !ns.lookup (function, table_symbol),
687
- id2string (function) + " not found" ,
688
- source_location);
689
-
690
683
auto expr_symbol_finder = [&](const exprt &e) {
691
684
find_symbols_sett typetags;
692
685
find_type_symbols (e.type (), typetags);
@@ -704,12 +697,13 @@ void goto_programt::instructiont::validate(
704
697
705
698
auto ¤t_source_location = source_location;
706
699
auto type_finder =
707
- [&ns, vm, &table_symbol, & current_source_location](const exprt &e) {
700
+ [&ns, vm, ¤t_source_location](const exprt &e) {
708
701
if (e.id () == ID_symbol)
709
702
{
710
703
const auto &goto_symbol_expr = to_symbol_expr (e);
711
704
const auto &goto_id = goto_symbol_expr.get_identifier ();
712
705
706
+ const symbolt *table_symbol;
713
707
if (!ns.lookup (goto_id, table_symbol))
714
708
{
715
709
bool symbol_expr_type_matches_symbol_table =
@@ -783,6 +777,7 @@ void goto_programt::instructiont::validate(
783
777
}
784
778
};
785
779
780
+ const symbolt *table_symbol;
786
781
switch (type)
787
782
{
788
783
case NO_INSTRUCTION_TYPE:
0 commit comments