Skip to content

Commit 93f2e1f

Browse files
author
martin
committed
Use is_bottom() to catch unreachable functions.
1 parent 5b604ae commit 93f2e1f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/analyses/ai.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,12 @@ bool ai_baset::do_function_call(
431431
assert(l_end->is_end_function());
432432

433433
// do edge from end of function to instruction after call
434-
std::unique_ptr<statet> tmp_state(make_temporary_state(get_state(l_end)));
434+
const statet &end_state=get_state(l_end);
435+
436+
if(end_state.is_bottom())
437+
return false; // function exit point not reachable
438+
439+
std::unique_ptr<statet> tmp_state(make_temporary_state(end_state));
435440
tmp_state->transform(l_end, l_return, *this, ns);
436441

437442
// Propagate those

0 commit comments

Comments
 (0)