File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,30 @@ static void get_symbols(
57
57
if (!ns.lookup (p.get_identifier (), s))
58
58
working_set.push_back (s);
59
59
}
60
+
61
+ // check for contract definitions
62
+ const exprt ensures =
63
+ static_cast <const exprt &>(code_type.find (ID_C_spec_ensures));
64
+ const exprt requires =
65
+ static_cast <const exprt &>(code_type.find (ID_C_spec_requires));
66
+
67
+ find_symbols_sett new_symbols;
68
+ find_type_and_expr_symbols (ensures, new_symbols);
69
+ find_type_and_expr_symbols (requires , new_symbols);
70
+
71
+ for (const auto &s : new_symbols)
72
+ {
73
+ // keep functions called in contracts within scope.
74
+ // should we keep local variables from the contract as well?
75
+ const symbolt *new_symbol = nullptr ;
76
+ if (!ns.lookup (s, new_symbol))
77
+ {
78
+ if (new_symbol->type .id () == ID_code)
79
+ {
80
+ working_set.push_back (new_symbol);
81
+ }
82
+ }
83
+ }
60
84
}
61
85
}
62
86
}
You can’t perform that action at this time.
0 commit comments