Skip to content
Snippets Groups Projects
Commit a7b40a45 authored by Thibault Martin's avatar Thibault Martin Committed by Virgile Prevosto
Browse files

Set falls-through loc to the end of the function

parent 24442cd6
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 15 deletions
...@@ -9485,6 +9485,7 @@ and doDecl local_env (isglobal: bool) (def: Cabs.definition) : chunk = ...@@ -9485,6 +9485,7 @@ and doDecl local_env (isglobal: bool) (def: Cabs.definition) : chunk =
(* Now see whether we can fall through to the end of the function *) (* Now see whether we can fall through to the end of the function *)
if blockFallsThrough !currentFunctionFDEC.sbody then begin if blockFallsThrough !currentFunctionFDEC.sbody then begin
let loc = endloc in let loc = endloc in
let* CurrentLocUpdated = endloc in
let protect_return,retval = let protect_return,retval =
(* Guard the [return] instructions we add with an (* Guard the [return] instructions we add with an
[\assert \false]*) [\assert \false]*)
......
# frama-c -wp [...] # frama-c -wp [...]
[kernel] Parsing stmtcompiler_test.i (no preprocessing) [kernel] Parsing stmtcompiler_test.i (no preprocessing)
[kernel:CERT:MSC:37] stmtcompiler_test.i:135: Warning: [kernel:CERT:MSC:37] stmtcompiler_test.i:142: Warning:
Body of function if_assert falls-through. Adding a return statement Body of function if_assert falls-through. Adding a return statement
[wp] Running WP plugin... [wp] Running WP plugin...
[kernel:annot:missing-spec] stmtcompiler_test.i:103: Warning: [kernel:annot:missing-spec] stmtcompiler_test.i:103: Warning:
......
[kernel] Parsing bts297.c (with preprocessing) [kernel] Parsing bts297.c (with preprocessing)
[kernel:CERT:MSC:37] bts297.c:4: Warning: [kernel:CERT:MSC:37] bts297.c:10: Warning:
Body of function abrupt falls-through. Adding a return statement Body of function abrupt falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
int abrupt(int x) int abrupt(int x)
......
[kernel] Parsing bts0452.i (no preprocessing) [kernel] Parsing bts0452.i (no preprocessing)
[kernel:CERT:MSC:37] bts0452.i:13: Warning: [kernel:CERT:MSC:37] bts0452.i:15: Warning:
Body of function f falls-through. Adding a return statement Body of function f falls-through. Adding a return statement
[kernel:CERT:MSC:37] bts0452.i:27: Warning: [kernel:CERT:MSC:37] bts0452.i:29: Warning:
Body of function h falls-through. Adding a return statement Body of function h falls-through. Adding a return statement
[kernel] Parsing use_spec.i (no preprocessing) [kernel] Parsing use_spec.i (no preprocessing)
[kernel:CERT:MSC:37] use_spec.i:18: Warning: [kernel:CERT:MSC:37] use_spec.i:19: Warning:
Body of function f falls-through. Adding a return statement Body of function f falls-through. Adding a return statement
[slicing] slicing requests in progress... [slicing] slicing requests in progress...
[eva] Analyzing a complete application starting at main [eva] Analyzing a complete application starting at main
......
[kernel] Parsing use_spec.i (no preprocessing) [kernel] Parsing use_spec.i (no preprocessing)
[kernel:CERT:MSC:37] use_spec.i:18: Warning: [kernel:CERT:MSC:37] use_spec.i:19: Warning:
Body of function f falls-through. Adding a return statement Body of function f falls-through. Adding a return statement
[slicing] slicing requests in progress... [slicing] slicing requests in progress...
[eva] Analyzing a complete application starting at main2 [eva] Analyzing a complete application starting at main2
......
[kernel] Parsing exit.c (with preprocessing) [kernel] Parsing exit.c (with preprocessing)
[kernel:CERT:MSC:37] exit.c:16: Warning: [kernel:CERT:MSC:37] exit.c:21: Warning:
Body of function g falls-through. Adding a return statement Body of function g falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
#include "errno.h" #include "errno.h"
......
[kernel] Parsing inline_calls.i (no preprocessing) [kernel] Parsing inline_calls.i (no preprocessing)
[kernel:CERT:MSC:37] inline_calls.i:40: Warning: [kernel:CERT:MSC:37] inline_calls.i:43: Warning:
Body of function f1 falls-through. Adding a return statement Body of function f1 falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
int f(void) int f(void)
......
[kernel] Parsing inline_calls.i (no preprocessing) [kernel] Parsing inline_calls.i (no preprocessing)
[kernel:CERT:MSC:37] inline_calls.i:40: Warning: [kernel:CERT:MSC:37] inline_calls.i:43: Warning:
Body of function f1 falls-through. Adding a return statement Body of function f1 falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
int f(void) int f(void)
......
[kernel] Parsing inline_calls.i (no preprocessing) [kernel] Parsing inline_calls.i (no preprocessing)
[kernel:CERT:MSC:37] inline_calls.i:40: Warning: [kernel:CERT:MSC:37] inline_calls.i:43: Warning:
Body of function f1 falls-through. Adding a return statement Body of function f1 falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
int f(void) int f(void)
......
[kernel] Parsing one_ret_assert.i (no preprocessing) [kernel] Parsing one_ret_assert.i (no preprocessing)
[kernel:CERT:MSC:37] one_ret_assert.i:8: Warning: [kernel:CERT:MSC:37] one_ret_assert.i:9: Warning:
Body of function g falls-through. Adding a return statement Body of function g falls-through. Adding a return statement
/* Generated by Frama-C */ /* Generated by Frama-C */
int X; int X;
......
[kernel] Parsing vla_switch.i (no preprocessing) [kernel] Parsing vla_switch.i (no preprocessing)
[kernel:CERT:MSC:37] vla_switch.i:16: Warning: [kernel:CERT:MSC:37] vla_switch.i:20: Warning:
Body of function case3 falls-through. Adding a return statement Body of function case3 falls-through. Adding a return statement
[kernel] User Error: vla_switch.i:7, cannot jump from switch statement bypassing initialization of variable b, declared at vla_switch.i:9 [kernel] User Error: vla_switch.i:7, cannot jump from switch statement bypassing initialization of variable b, declared at vla_switch.i:9
[kernel] Frama-C aborted: invalid user input. [kernel] Frama-C aborted: invalid user input.
[kernel] Parsing imprecise_invalid_write.i (no preprocessing) [kernel] Parsing imprecise_invalid_write.i (no preprocessing)
[kernel:CERT:MSC:37] imprecise_invalid_write.i:5: Warning: [kernel:CERT:MSC:37] imprecise_invalid_write.i:6: Warning:
Body of function main1 falls-through. Adding a return statement Body of function main1 falls-through. Adding a return statement
[kernel:CERT:MSC:37] imprecise_invalid_write.i:10: Warning: [kernel:CERT:MSC:37] imprecise_invalid_write.i:11: Warning:
Body of function main2 falls-through. Adding a return statement Body of function main2 falls-through. Adding a return statement
[kernel:CERT:MSC:37] imprecise_invalid_write.i:17: Warning: [kernel:CERT:MSC:37] imprecise_invalid_write.i:18: Warning:
Body of function main3 falls-through. Adding a return statement Body of function main3 falls-through. Adding a return statement
[eva] Analyzing a complete application starting at main [eva] Analyzing a complete application starting at main
[eva] Computing initial state [eva] Computing initial state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment