Skip to content

Commit ca693b4

Browse files
Make sure that both the caller and callee have exceptional return vars before instrumenting function calls
1 parent 047671b commit ca693b4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/analyses/uncaught_exceptions_analysis.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ static void get_subtypes(
5252
candidate)!=subtypes.end())
5353
continue;
5454
// get its base class
55-
const irept::subt &bases=to_class_type((it->second).type).bases();
55+
const class_typet::basest &bases=
56+
to_class_type((it->second).type).bases();
5657
if(bases.size()>0)
5758
{
58-
const irept &base = bases[0];
59+
const class_typet::baset &base = bases[0];
5960
const irept &base_type=base.find(ID_type);
6061
assert(base_type.id()==ID_symbol);
6162

src/goto-programs/remove_exceptions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ void remove_exceptionst::instrument_function_call(
386386
const irep_idt &callee_id=
387387
to_symbol_expr(function_call.function()).get_identifier();
388388

389-
if(symbol_table.has_symbol(id2string(callee_id)+EXC_SUFFIX))
389+
if(symbol_table.has_symbol(id2string(callee_id)+EXC_SUFFIX) &&
390+
symbol_table.has_symbol(id2string(function_id)+EXC_SUFFIX))
390391
{
391392
// we may have an escaping exception
392393
const symbolt &callee_exc_symbol=

0 commit comments

Comments
 (0)