Skip to content
Snippets Groups Projects
Commit 23e7d9b3 authored by David Bühler's avatar David Bühler
Browse files

Merge branch 'fix/eva/recursive-calls' into 'master'

[Eva] Do not fail on recursive calls without specification.

See merge request frama-c/frama-c!3163
parents db604585 963c91a5
No related branches found
No related tags found
No related merge requests found
......@@ -46,13 +46,20 @@ let mark_unknown_requires kinstr kf funspec =
let get_spec kinstr kf =
let funspec = Annotations.funspec ~populate:false kf in
if Cil.is_empty_funspec funspec then
Value_parameters.abort ~current:true
"@[Recursive call to %a@ without a specification.@ Try to increase@ \
the %s parameter@ or write a specification@ for function %a.@]"
if Cil.is_empty_funspec funspec then begin
Value_parameters.error ~current:true
"@[Recursive call to %a@ without a specification.@ \
Generating probably incomplete assigns to interpret the call.@ \
Try to increase@ the %s parameter@ \
or write a correct specification@ for function %a.%t@]"
Kernel_function.pretty kf
Value_parameters.RecursiveUnroll.name
Kernel_function.pretty kf
Value_util.pp_callstack;
Cil.CurrentLoc.set (Kernel_function.get_location kf);
ignore (!Annotations.populate_spec_ref kf funspec);
Annotations.funspec kf
end
else
let depth = Value_parameters.RecursiveUnroll.get () in
let () =
......
......@@ -11,7 +11,52 @@
[eva] tests/value/recursion.c:437: Frama_C_show_each_36: {36}
[eva] using specification for function Frama_C_interval
[eva] tests/value/recursion.c:425: User Error:
Recursive call to sum_nospec without a specification. Try to increase
the -eva-unroll-recursive-calls parameter or write a specification
Recursive call to sum_nospec without a specification.
Generating probably incomplete assigns to interpret the call. Try to increase
the -eva-unroll-recursive-calls parameter or write a correct specification
for function sum_nospec.
[kernel:annot:missing-spec] tests/value/recursion.c:422: Warning:
Neither code nor specification for function sum_nospec, generating default assigns from the prototype
[eva] using specification for function sum_nospec
[eva] tests/value/recursion.c:441:
Frama_C_show_each_unreachable: [-2147483648..2147483647]
[eva] done for function main_fail
[eva] ====== VALUES COMPUTED ======
[eva:final-states] Values at end of function sum_nospec:
res ∈ [--..--]
__retres ∈ [--..--]
[eva:final-states] Values at end of function main_fail:
Frama_C_entropy_source ∈ [--..--]
x ∈ [4..16]
y ∈ [--..--]
[from] Computing for function sum_nospec
[from] Computing for function sum_nospec <-sum_nospec
[from] Done for function sum_nospec
[from] Done for function sum_nospec
[from] Computing for function main_fail
[from] Computing for function Frama_C_interval <-main_fail
[from] Done for function Frama_C_interval
[from] Done for function main_fail
[from] ====== DEPENDENCIES COMPUTED ======
These dependencies hold at termination for the executions that terminate:
[from] Function Frama_C_interval:
Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF)
\result FROM Frama_C_entropy_source; min; max
[from] Function sum_nospec:
res FROM i
tmp FROM i
__retres FROM i
\result FROM i
[from] Function main_fail:
Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF)
[from] ====== END OF DEPENDENCIES ======
[inout] Out (internal) for function sum_nospec:
res; tmp; __retres
[inout] Inputs for function sum_nospec:
i; res; tmp; __retres
[inout] Out (internal) for function main_fail:
Frama_C_entropy_source; x; y; tmp; tmp_0; tmp_1
[inout] Inputs for function main_fail:
Frama_C_entropy_source
[eva] User Error: Deferred error message was emitted during execution. See above messages for more information.
[kernel] Plug-in eva aborted: invalid user input.
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