Warnings and Dead Code Handling for noreturn#953
Warnings and Dead Code Handling for noreturn#953michael-schwarz merged 6 commits intogoblint:masterfrom
noreturn#953Conversation
8cf3ad9 to
54f03d9
Compare
|
We found the problem to be that the CFG construction in Goblint checks the number of (real) successors of an We decided to add an option in CIL so that functions that fall through (can reach the end of the body), yet don't contain return statements, always get a return statement added by CIL—even those marked |
|
still depends on goblint/cil#129, otherwise ready to merge |
75049d5 to
f3d71f4
Compare
|
I merged the CIL PR. Could you update the pin in the opam files so we can see if the CI is happy then? |
|
should be ready now |
Resolves #501.
Changes:
noreturn,Deadcodeif the optionsem.noreturn.dead_codeis enabled.Added an
Othervariant toundefined_behaviorfor the message category, but could also just as well be categoryUnknown.However, from what I can tell there's an issue here with how CIL handles
noreturn. Here are the CFGs generated for the following function, once marked withnoreturnand once unmarked:CFG for
without_noreturnCFG for
with_noreturnMy guess is that reaching the end of a
noreturnfunction is undefined behaviour, so CIL is allowed to do this.