Skip to content

Commit

Permalink
Issue non-termination warning for longjmp calls
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Oct 12, 2023
1 parent 8be0343 commit 44b4492
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/framework/constraints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,15 @@ struct
)
in
List.iter handle_path (S.paths_as_set conv_ctx);
if !AnalysisState.should_warn && List.mem "termination" @@ get_string_list "ana.activated" then (
AnalysisState.svcomp_may_not_terminate := true;
let msgs =
[(Pretty.dprintf
"The program might not terminate! (Longjmp)",
None
);] in
M.msg_group Warning ~category:NonTerminating "Possibly non terminating loops" msgs
);
S.D.bot ()
| _ -> S.special conv_ctx lv f args
let threadenter ctx = S.threadenter (conv ctx)
Expand Down
11 changes: 11 additions & 0 deletions tests/regression/78-termination/49-longjmp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SKIP NONTERM PARAM: --set "ana.activated[+]" termination --set ana.activated[+] apron --enable ana.int.interval --set ana.apron.domain polyhedra
#include <setjmp.h>
jmp_buf buf;
int main()
{
if(setjmp(buf)) {

}

longjmp(buf, 1);
}

0 comments on commit 44b4492

Please sign in to comment.