Skip to content

Commit

Permalink
Merge pull request #1347 from goblint/evalfunvar-dead
Browse files Browse the repository at this point in the history
Fix no function to call warnings on dead code
  • Loading branch information
sim642 authored Jan 29, 2024
2 parents 9178c43 + 82c9f97 commit 5224948
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/constraints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ struct
None
in
let funs = List.filter_map one_function functions in
if [] = funs then begin
if [] = funs && not (S.D.is_bot ctx.local) then begin
M.msg_final Warning ~category:Unsound ~tags:[Category Call] "No suitable function to call";
M.warn ~category:Unsound ~tags:[Category Call] "No suitable function to be called at call site. Continuing with state before call.";
d (* because LevelSliceLifter *)
Expand Down
8 changes: 8 additions & 0 deletions tests/regression/00-sanity/38-evalfunvar-dead.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdlib.h>

int main() {
int (*fp)() = &rand;
abort();
fp(); // NOWARN (No suitable function to call)
return 0;
}

0 comments on commit 5224948

Please sign in to comment.