Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
043dfaee
Commit
043dfaee
authored
3 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[analysis-scripts/make_wrapper.py] more permissive inputs
parent
84795a2a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
share/analysis-scripts/make_wrapper.py
+33
-33
33 additions, 33 deletions
share/analysis-scripts/make_wrapper.py
src/plugins/value/engine/recursion.ml
+4
-1
4 additions, 1 deletion
src/plugins/value/engine/recursion.ml
with
37 additions
and
34 deletions
share/analysis-scripts/make_wrapper.py
+
33
−
33
View file @
043dfaee
...
...
@@ -80,12 +80,44 @@ with subprocess.Popen(cmd_list,
re_missing_spec
=
re
.
compile
(
"
Neither code nor specification for function ([^,]+),
"
)
re_recursive_call_start
=
re
.
compile
(
"
detected recursive call
"
)
re_recursive_call_stack_start
=
re
.
compile
(
"
^\s+stack:
"
)
re_recursive_call_stack_end
=
re
.
compile
(
"
\[
kernel:annot:missing-spec\]
"
)
re_recursive_call_stack_end
=
re
.
compile
(
"
^
\[
"
)
tips
=
[]
lines
=
iter
(
output_lines
)
for
line
in
lines
:
match
=
re_recursive_call_start
.
search
(
line
)
if
match
:
def
action
():
print
(
"
Consider patching, stubbing or adding an ACSL
"
+
"
specification to the recursive call,
"
+
"
then re-run the analysis.
"
)
while
True
:
msg_lines
=
[]
match
=
re_recursive_call_start
.
search
(
line
)
try
:
while
not
match
:
line
=
next
(
lines
)
match
=
re_recursive_call_start
.
search
(
line
)
match
=
None
while
not
match
:
line
=
next
(
lines
)
match
=
re_recursive_call_stack_start
.
search
(
line
)
match
=
None
while
not
match
:
msg_lines
.
append
(
line
)
line
=
next
(
lines
)
match
=
re_recursive_call_stack_end
.
search
(
line
)
# note: this ending line can also match re_missing_spec
tip
=
{
"
message
"
:
"
Found recursive call at:
\n
"
+
""
.
join
(
msg_lines
),
"
action
"
:
action
}
tips
.
append
(
tip
)
break
except
StopIteration
:
print
(
"
** Error: did not match expected regex before EOF
"
)
assert
False
match
=
re_missing_spec
.
search
(
line
)
if
match
:
fname
=
match
.
group
(
1
)
...
...
@@ -120,38 +152,6 @@ for line in lines:
"
action
"
:
partial
(
action
,
fname
)
}
tips
.
append
(
tip
)
else
:
match
=
re_recursive_call_start
.
search
(
line
)
if
match
:
def
action
():
print
(
"
Consider patching, stubbing or adding an ACSL
"
+
"
specification to the recursive call,
"
+
"
then re-run the analysis.
"
)
while
True
:
msg_lines
=
[]
match
=
re_recursive_call_start
.
search
(
line
)
try
:
while
not
match
:
line
=
next
(
lines
)
match
=
re_recursive_call_start
.
search
(
line
)
match
=
None
while
not
match
:
line
=
next
(
lines
)
match
=
re_recursive_call_stack_start
.
search
(
line
)
match
=
None
while
not
match
:
msg_lines
.
append
(
line
)
line
=
next
(
lines
)
match
=
re_recursive_call_stack_end
.
search
(
line
)
tip
=
{
"
message
"
:
"
Found recursive call at:
\n
"
+
""
.
join
(
msg_lines
),
"
action
"
:
action
}
tips
.
append
(
tip
)
break
except
StopIteration
:
print
(
"
** Error: did not match expected regex before EOF
"
)
assert
False
if
tips
!=
[]:
print
(
""
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/value/engine/recursion.ml
+
4
−
1
View file @
043dfaee
...
...
@@ -51,7 +51,10 @@ let get_spec kinstr kf =
"@[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@]"
or write a correct specification@ for function %a.@
\n
%t@]"
(* note: the "\n" before the pretty print of the stack is required by:
FRAMAC_SHARE/analysis-scripts/make_wrapper.py
*)
Kernel_function
.
pretty
kf
Value_parameters
.
RecursiveUnroll
.
name
Kernel_function
.
pretty
kf
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment