You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lzaoral
changed the title
Incorrect slicing of programs ending with an exit(3) call.
Incorrect slicing of functions ending with an noreturn call.
Dec 29, 2021
The issue is actually more complex than just error(3). The same applies to any function (e.g. not just main) that does not return and is decorated by _Noreturn function specifier from C11 (the same probably holds for __attribute__((noreturn)) as well). Note that such function will have the noreturn function attribute in LLVM.
It's important to check bodies of all such functions though because as C11 says:
If the function declared _Noreturn returns, the behaviour is undefined.
So just replacing all undefined instructions in IR after calls of functions with noreturn attributes will hide this issue.
lzaoral
changed the title
Incorrect slicing of functions ending with an noreturn call.
Incorrect slicing of functions ending with a noreturn call.
Jun 22, 2022
Consider the following C program
and slice it like this:
Problem: The sliced bitcode now has a reachable
unreachable
instruction becausetest_assert
will always return:EDIT: typo
The text was updated successfully, but these errors were encountered: