Skip to content

Commit 0c05be6

Browse files
Allow convert_lazy_method on functions that don't have a lazy body
The call will do nothing if a lazy body doesn't exist to be converted This allows calling for example on functions that will be stubbed
1 parent 05a8da2 commit 0c05be6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/util/language_file.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ Author: Daniel Kroening, [email protected]
1717
#include <memory> // unique_ptr
1818

1919
#include "message.h"
20+
#include "symbol_table.h"
2021

21-
class symbol_tablet;
22-
class symbol_table_baset;
2322
class language_filet;
2423
class languaget;
2524

@@ -92,19 +91,17 @@ class language_filest:public messaget
9291

9392
bool interfaces(symbol_tablet &symbol_table);
9493

95-
bool has_lazy_method(const irep_idt &id)
96-
{
97-
return lazy_method_map.count(id)!=0;
98-
}
99-
10094
// The method must have been added to the symbol table and registered
10195
// in lazy_method_map (currently always in language_filest::typecheck)
10296
// for this to be legal.
10397
void convert_lazy_method(
10498
const irep_idt &id,
10599
symbol_tablet &symbol_table)
106100
{
107-
return lazy_method_map.at(id)->convert_lazy_method(id, symbol_table);
101+
PRECONDITION(symbol_table.has_symbol(id));
102+
lazy_method_mapt::iterator it=lazy_method_map.find(id);
103+
if(it!=lazy_method_map.end())
104+
it->second->convert_lazy_method(id, symbol_table);
108105
}
109106

110107
void clear()

0 commit comments

Comments
 (0)