Skip to content
Snippets Groups Projects
Commit 7dd5bd76 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

Merge branch 'fix/martin/kernel/do-not-add-empty-default-behavior' into 'master'

Add the newly created behavior only if it is not empty

See merge request frama-c/frama-c!4370
parents 517cc90b 5b924bea
No related branches found
No related tags found
No related merge requests found
...@@ -869,19 +869,23 @@ let do_populate ?loc kf clauses = ...@@ -869,19 +869,23 @@ let do_populate ?loc kf clauses =
let generated original = function let generated original = function
| Kept -> original | Kept -> original
| Generated g -> g | Generated clauses -> clauses
in in
let bhv = Cil.mk_behavior () in let bhv = Cil.mk_behavior () in
let bhv = { bhv with b_post_cond = generated bhv.b_post_cond exits } in bhv.b_post_cond <- generated bhv.b_post_cond exits;
let bhv = { bhv with b_assigns = generated bhv.b_assigns assigns } in bhv.b_assigns <- generated bhv.b_assigns assigns;
let bhv = { bhv with b_requires = generated bhv.b_requires requires } in bhv.b_requires <- generated bhv.b_requires requires;
let bhv = { bhv with b_allocation = generated bhv.b_allocation allocates } in bhv.b_allocation <- generated bhv.b_allocation allocates;
let is_empty_bhv =
exits = Kept && assigns = Kept && requires = Kept && allocates = Kept
in
let spec = Cil.empty_funspec () in let spec = Cil.empty_funspec () in
let spec = { spec with spec_behavior = [ bhv ] } in spec.spec_behavior <- if is_empty_bhv then spec.spec_behavior else [ bhv ];
let spec = spec.spec_terminates <- generated spec.spec_terminates terminates;
{ spec with spec_terminates = generated spec.spec_terminates terminates } in
Annotations.add_spec emitter_populate kf spec; Annotations.add_spec emitter_populate kf spec;
Exits.emit config.c_exits kf bhv exits; Exits.emit config.c_exits kf bhv exits;
Assigns.emit config.c_assigns kf bhv assigns; Assigns.emit config.c_assigns kf bhv assigns;
......
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
[eva] Initial state computed [eva] Initial state computed
[eva:initial-state] Values of globals at initialization [eva:initial-state] Values of globals at initialization
nondet ∈ [--..--] nondet ∈ [--..--]
[kernel:prop-status:emit]
Frama-C kernel emits status unknown for property default behavior
under 2 hypothesis
[eva] computing for function f <- main. [eva] computing for function f <- main.
Called from behavior_statuses.i:26. Called from behavior_statuses.i:26.
[eva] using specification for function f [eva] using specification for function f
......
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